Browse files

* Remove merge conflict text

  • Loading branch information...
1 parent f47945a commit 6498c4dea83853e803ed4036f8aa491609773be8 @joehewitt committed Oct 5, 2011
Showing with 1 addition and 5 deletions.
  1. +1 −5 scrollability.min.js
View
6 scrollability.min.js
@@ -1,5 +1 @@
-<<<<<<< HEAD
-(function(){var a=document.createElement("style");a.innerHTML='.scrollable{-webkit-transform:translate3d(0,0,0)}.scrollability-scrollbar{position:absolute;top:0;right:2px;width:7px;height:1px;z-index:2147483647;opacity:0;-webkit-transform:translate3d(0,0,0);-webkit-box-sizing:border-box;-webkit-transform-origin:top left;background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAABCAYAAADuHp8EAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAC5JREFUeNpi/P//vyQDAwMjKytr2Z8/f9gYIICRAQH+Q/n/WVhYfgNBJ4gNEGAAhVUOGMTI0TwAAAAASUVORK5CYII=") no-repeat}',document.head.appendChild(a)})(),function(){(function(a,b,c){function d(){var a=[];a.push.apply(a,arguments),console.log(a.join(" "))}function E(){var a=document.createElement("style");document.head.appendChild(a),C=document.styleSheets[document.styleSheets.length-1]}function F(a){function f(a){a.preventDefault(),y=!0,e&&(clearTimeout(e),e=0),c&&(M(c),c=null);var b=g?a.touches[0]:a;w=b.clientX,x=b.clientY;if(A.length>1)for(var d=0;d<A.length;++d){var f=A[d];if(f.disable&&f.disable(w,x,u,v)){f.terminate(),A.splice(d--,1);if(A.length==1){var h=A[0];T("scrollability-lock",h.node,{direction:h.direction})}}}A.forEach(function(b){var c=b.filter(w,x);b.track(c,a.timeStamp)})}function h(a){if(c){var b=document.createEvent("MouseEvents");b.initMouseEvent("click",!0,!0,window,1),c[0].dispatchEvent(b),M(c)}document.removeEventListener(g?"touchmove":"mousemove",f,!1),document.removeEventListener(g?"touchend":"mouseup",h,!1),A.forEach(function(a){a.takeoff()})}var b=g?a.touches[0]:a,c=null;w=u=b.clientX,x=v=b.clientY,y=!1,A=H(a.target,w,x,a.timeStamp);if(!A.length)return!0;var d=a.target,e=setTimeout(function(){e=0,c=L(d)},50);document.addEventListener(g?"touchmove":"mousemove",f,!1),document.addEventListener(g?"touchend":"mouseup",h,!1)}function G(a,b,c,d){function X(a,b){N.push({node:a,callback:b,keyframes:[]})}function Y(a){D=a}function Z(a){P=a,$(I,J)}function $(a,b){L=b-J,J=b,E=a-I,I=a,Math.abs(E)<i?++M:(M&&--M,M=0);if(f)if(v>x&&A==x){var c=v-x;E*=(1-c/G)*k}else if(v<w&&z==w){var c=w-v;E*=(1-c/G)*k}return v+=E,bc(v),e.style.webkitAnimationName="",N.forEach(function(a){a.node.style.webkitAnimationName=""}),!0}function _(a){var b=-w-x;if(u&&j<b){var c=j-q*2,d=c/b*c,e;if(a>x)d=Math.max(d-(a-x),r),e=0;else if(a<w){var f=d-(w-a);d=Math.max(d-(w-a),r),e=c-d}else e=Math.abs(a)/b*(c-d);return e+=q,"translate3d(0, "+Math.round(e)+"px, 0) "+"scaleY("+Math.round(d)+")"}}function ba(){M&&(E=0),v+=E,bc(v),E=E/L*s;var b=bb();if(!b.time){bf();return}T("scrollability-animate",e,{direction:a.direction,time:b.time,keyframes:b.keyframes}),e.cleanup&&e.cleanup(),C.insertRule(b.css,0),N.forEach(function(c,d){c.name="scrollability-track"+B++;var e=K(a,c.keyframes,c.name,b.time);C.insertRule(e,0)}),e.earlyEnd=function(){be(!0)},e.normalEnd=function(){bd(b.keyframes[b.keyframes.length-1].position),be()},e.cleanup=function(){delete e.cleanup,C.deleteRule(0),N.forEach(function(a){C.deleteRule(0)})},e.addEventListener("webkitAnimationEnd",e.normalEnd,!1),R(e,b.name,b.time),N.forEach(function(a){R(a.node,a.name,b.time)})}function bb(){function Q(a){var f=v-c;if(a||b-d>=t||e<0!=f<0)o.push({position:v,time:b}),N.forEach(function(a){a.keyframes.push({time:b,css:a.callback(v)})}),e=f,c=v,d=b}var b=0,c=v,d=0,e=0,i,k,m=0,n,o=[];if(g)if(Math.abs(v-x)>H||Math.abs(E)>p)if(v>x){if(x!=A){x+=j+D,w+=j+D;var q=w%j,r=-Math.round((v+j-q)/(j+D));T("scrollability-page",a.node,{page:r})}}else if(w!=z){x-=j+D,w-=j+D;var q=w%j,r=-Math.round((v-j-q)/(j+D));T("scrollability-page",a.node,{page:r})}var u=!0;while(u){if(v>x&&f)if(E>0){var y=v-x,C=1-y/G;E=Math.max(E-l,0)*C,v+=E}else m||(i=v,k=x-v),v=O(m,i,k,F),u=++m<=F&&Math.floor(Math.abs(v))>x;else if(v<w&&f)if(E<0){var y=w-v,C=1-y/G;E=Math.min(E+l,0)*C,v+=E}else m||(i=v,k=w-v),v=O(m,i,k,F),u=++m<=F&&Math.ceil(v)<w;else{u=Math.floor(Math.abs(E)*10)>0;if(!u)break;E*=h,v+=E}Q(!u),b+=s}if(g){var I=Math.round(v/(j+D));v=I*(j+D),Q(!0)}else v>x&&f?(v=x,Q(!0)):v<w&&f&&(v=w,Q(!0));var J=o.length?o[o.length-1].time:0,L="scrollability"+B++,M=K(a,o,L,J,P);return{time:J,position:v,keyframes:o,name:L,css:M}}function bc(b){if(!T("scrollability-scroll",e,{direction:a.direction,position:b}))return;bd(b),u&&y&&S(u)}function bd(b){e.style.webkitTransform=a.update(b+P),e.scrollableOffset=P,N.forEach(function(a){a.node.style.webkitTransform=a.callback(b)})}function be(b){u&&(b?S(u):(u.style.opacity="0",u.style.webkitTransition="opacity 0.33s linear")),e.removeEventListener("webkitAnimationEnd",e.normalEnd,!1),delete e.earlyEnd,delete e.normalEnd,a.mute||T("scrollability-end",e)}function bf(){be()}var e=a.node,f=a.constrained,g=a.paginated,j=a.viewport||0,u=a.scrollbar,v=a.position,w=a.min,x=a.max,z=w,A=Math.round(x/j)*j,D=0,E=0,F=g?n:m,G=a.bounce,H=j*o,I=startTouch=a.filter(b,c),J=d,L=0,M=0,N=[],P=e.scrollableOffset||0;if(!a.mute){var Q={position:v,track:X,setSpacing:Y,setOffset:Z};if(!T("scrollability-start",e,Q))return null}if(g){if(D===undefined){var U=Math.round(Math.abs(z)%j),V=(Math.abs(z)-U)/j+1;D=U/V}var W=Math.round(v/(j+D));w=x=W*(j+D),z+=D}return u&&(X(u,_),u.parentNode||e.parentNode.appendChild(u)),e.earlyEnd&&(R(e),N.forEach(function(a){R(a.node)}),e.earlyEnd(),bc(v)),a.reposition=bc,a.track=$,a.takeoff=ba,a.terminate=bf,a}function H(a,b,c,d){var e=[],f=document.querySelectorAll(".scrollable.universal");for(var g=0;g<f.length;++g)I(f[g],e,b,c,d);return f.length||I(a,e,b,c,d),e}function I(a,b,c,d,e){while(a){if(a.nodeType==1){var f=J(a,c,d,e);if(f){var g=!1;for(var h=0;h<b.length;++h)if(b[h].node==a){g=!0;break}g||(f=G(f,c,d,e),f&&b.push(f))}}a=a.parentNode}}function J(a,b,c,d){var e=a.className.split(" ");if(e.indexOf("scrollable")==-1)return;for(var f=0;f<e.length;++f){var g=e[f];if(D[g]){var h=D[g](a);return h.direction=g,h.paginated=e.indexOf("paginated")!=-1,h}}}function K(a,b,c,d,e){var f=["@-webkit-keyframes "+c+" {"];return b.forEach(function(b){var c=b.time/d*100,g=Math.floor(c)+"% {"+"-webkit-transform: "+(b.css||a.update(b.position+e))+";"+"}";f.push(g)}),f.push("}"),f.join("\n")}function L(a){var b=[];for(var c=a;c;c=c.parentNode)c.nodeType==1&&(c.className=(c.className?c.className+" ":"")+"touched",b.push(c));return b}function M(a){for(var b=0;b<a.length;++b){var c=a[b];c.className=c.className.replace("touched","")}}function N(a){if(!a.scrollableScrollbar){var b=a.scrollableScrollbar=document.createElement("div");b.className="scrollability-scrollbar"}return a.scrollableScrollbar}function O(a,b,c,d){return a==d?b+c:c*(-Math.pow(2,-10*a/d)+1)+b}function P(a){var b=a.parentNode,c=a.querySelector(".scrollable > .clipper")||a;a.style.webkitAnimation&&(a.style.webkitAnimationPlayState="paused");var d=getComputedStyle(a).webkitTransform,e=(new WebKitCSSMatrix(d)).m41-(a.scrollableOffset||0);return{node:a,min:-c.offsetWidth+b.offsetWidth,max:0,position:e,viewport:b.offsetWidth,bounce:b.offsetWidth*k,constrained:!0,filter:function(a,b){return a},disable:function(a,b,c,d){var e=Math.abs(a-c),f=Math.abs(b-d);if(f>e&&f>j)return!0},update:function(a){return"translate3d("+Math.round(a)+"px, 0, 0)"}}}function Q(a){var b=a.parentNode,c=a.querySelector(".scrollable > .clipper")||a;a.style.webkitAnimation&&(a.style.webkitAnimationPlayState="paused");var d=getComputedStyle(a).webkitTransform,e=(new WebKitCSSMatrix(d)).m42;return{node:a,scrollbar:N(a),position:e,min:-c.offsetHeight+b.offsetHeight,max:0,viewport:b.offsetHeight,bounce:b.offsetHeight*k,constrained:!0,filter:function(a,b){return b},disable:function(a,b,c,d){var e=Math.abs(a-c),f=Math.abs(b-d);if(e>f&&e>j)return!0},update:function(a){return"translate3d(0, "+Math.round(a)+"px, 0)"}}}function R(a,b,c){b&&(a.style.webkitAnimation=b+" "+c+"ms linear both"),a.style.webkitAnimationPlayState=b?"running":"paused"}function S(a){a.style.webkitTransition="",a.style.opacity="1"}function T(a,b,c){var d=document.createEvent("Events");d.initEvent(a,!1,!0);if(c)for(var a in c)d[a]=c[a];return b.dispatchEvent(d)}"style scrollability/scrollbar.css";var e="webkitTransform"in document.documentElement.style,f=e&&/OS 5_/.exec(navigator.userAgent),g="ontouchstart"in window,h=.9925,i=4,j=10,k=.75,l=.01,m=240,n=160,o=.5,p=2,q=2,r=7,s=4,t=24,u,v,w,x,y,z=0,A=[],B=0,C,D={horizontal:P,vertical:Q};b.directions=D,b.flashIndicators=function(){},a.ready(function(){document.addEventListener(g?"touchstart":"mousedown",F,!1),window.addEventListener("load",E,!1)})})({ready:function(a){a()}},window,{exports:window})}()
-=======
-(function(){var a=document.createElement("style");a.innerHTML='.scrollable{-webkit-transform:translate3d(0,0,0)}.scrollability-scrollbar{position:absolute;top:0;right:2px;width:7px;height:1px;z-index:2147483647;opacity:0;-webkit-transform:translate3d(0,0,0);-webkit-box-sizing:border-box;-webkit-transform-origin:top left;background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAABCAYAAADuHp8EAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAC5JREFUeNpi/P//vyQDAwMjKytr2Z8/f9gYIICRAQH+Q/n/WVhYfgNBJ4gNEGAAhVUOGMTI0TwAAAAASUVORK5CYII=") no-repeat}',document.head.appendChild(a)})(),function(){(function(a,b,c){function C(){b.flashIndicators()}function D(a,b,c,d){function U(a,b){Q.push({node:a,callback:b,keyframes:[]})}function V(a,b){L=b-J,J=b,D=a-H,H=a,Math.abs(D)>=h?(M&&--M,M=0):++M;if(f)if(v>y&&B==y){var c=v-y;D*=(1-c/F)*j}else if(v<w&&z==w){var c=w-v;D*=(1-c/F)*j}return v+=D,Z(v),e.style.webkitAnimationName="",Q.forEach(function(a){a.node.style.webkitAnimationName=""}),!0}function W(a){var b=-w-y;if(u&&t<b){var c=t-p*2,d=c/b*c,e;if(a>y)d=Math.max(d-(a-y),q),e=0;else if(a<w){var f=d-(w-a);d=Math.max(d-(w-a),q),e=c-d}else e=Math.abs(a)/b*(c-d);return e+=p,"translate3d(0, "+Math.round(e)+"px, 0) "+"scaleY("+Math.round(d)+")"}}function X(){function g(){$(b.keyframes[b.keyframes.length-1].position),_()}M&&(_(),D=0),Z(v+D),D=D/L*r;var b=Y();if(!b.time){_();return}P("scrollability-animate",e,{direction:a.direction,time:b.time,keyframes:b.keyframes});var c=document.styleSheets[0],d=c.rules.length;c.insertRule(b.css,d),Q.forEach(function(e,f){e.name="scrollability-track"+A++;var g=I(a,e.keyframes,e.name,b.time);c.insertRule(g,d+f+1)});var f=e.dirtyEnding=function(){delete e.dirtyEnding,e.removeEventListener("webkitAnimationEnd",g,!1),u&&O(u),a.mute||P("scrollability-end",e)};e.addEventListener("webkitAnimationEnd",g,!1);var h=e.cleanup;e.cleanup=function(){delete e.cleanup,c.deleteRule(d),Q.forEach(function(a){c.deleteRule(d)})},N(e,b.name,b.time),Q.forEach(function(a){N(a.node,a.name,b.time)}),h&&h()}function Y(){function M(a){var f=v-c;if(a||b>=s&&(b-d>=s||e<0!=f<0))n.push({position:v,time:b}),Q.forEach(function(a){a.keyframes.push({time:b,css:a.callback(v)})}),e=f,c=v,d=b}var b=0,c=v,d=0,e=0,h,j,l=0,m,n=[];i&&(Math.abs(v-y)>G||Math.abs(D)>o)&&(v>y?y!=B&&(y+=t+C,w+=t+C):w!=z&&(y-=t+C,w-=t+C));var p=!0;while(p){if(v>y&&f)if(D>0){var q=v-y,u=1-q/F;D=Math.max(D-k,0)*u,v+=D}else l||(h=v,j=y-v),v=K(l,h,j,E),p=++l<=E&&Math.floor(Math.abs(v))>y;else if(v<w&&f)if(D<0){var q=w-v,u=1-q/F;D=Math.min(D+k,0)*u,v+=D}else l||(h=v,j=w-v),v=K(l,h,j,E),p=++l<=E&&Math.ceil(v)<w;else D*=g,v+=D,p=Math.floor(Math.abs(D)*10)>0;M(!p),b+=r}if(i){var x=Math.round(v/t);v=x*(t+C),M(!0)}else v>y&&f?(v=y,M(!0)):v<w&&f&&(v=w,M(!0));var H=n.length?n[n.length-1].time:0,J="scrollability"+A++,L=I(a,n,J,H);return{time:H,position:v,keyframes:n,name:J,css:L}}function Z(b){if(!P("scrollability-scroll",e,{direction:a.direction,position:b}))return;$(b),u&&x&&O(u)}function $(b){e.style.webkitTransform=a.update(b),Q.forEach(function(a){a.node.style.webkitTransform=a.callback(b)})}function _(){e.dirtyEnding&&e.dirtyEnding(),u&&(u.style.opacity="0",u.style.webkitTransition="opacity 0.33s linear")}var e=a.node,f=a.constrained,i=a.paginated,t=a.viewport||0,u=a.scrollbar,v=a.position,w=a.min,y=a.max,z=w,B=Math.round(y/t)*t,C=0,D=0,E=i?m:l,F=a.bounce,G=t*n,H=startTouch=a.filter(b,c),J=d,L=0,M=0,Q=[];if(i){var R=Math.round(Math.abs(z)%t),S=(Math.abs(z)-R)/t+1,C=R/S,T=Math.round(v/t);w=y=T*(t+C),z+=C}return!a.mute&&!P("scrollability-start",e,{track:U})?null:(u&&(U(u,W),u.parentNode||e.parentNode.appendChild(u)),e.dirtyEnding&&(N(e),Q.forEach(function(a){N(a.node)}),e.dirtyEnding(),Z(v)),a.reposition=Z,a.track=V,a.takeoff=X,a.terminate=_,a)}function E(a,b){for(var c=0;c<z.length;++c){var d=z[c],e=d.filter(v,w);b?d.track(e,a):d.takeoff()}}function F(a,b,c,d){var e=[],f=document.querySelectorAll(".scrollable.universal");for(var g=0;g<f.length;++g)G(f[g],e,b,c,d);return f.length||G(a,e,b,c,d),e}function G(a,b,c,d,e){while(a){if(a.nodeType==1){var f=H(a,c,d,e);if(f){var g=!1;for(var h=0;h<b.length;++h)if(b[h].node==a){g=!0;break}g||(f=D(f,c,d,e),f&&b.push(f))}}a=a.parentNode}}function H(a,b,c,d){var e=a.className.split(" ");if(e.indexOf("scrollable")==-1)return;for(var f=0;f<e.length;++f){var g=e[f];if(B[g]){var h=B[g](a);return h.direction=g,h.paginated=e.indexOf("paginated")!=-1,h}}}function I(a,b,c,d){var e=["@-webkit-keyframes "+c+" {"];return b.forEach(function(b){var c=b.time/d*100,f=Math.floor(c)+"% {"+"-webkit-transform: "+(b.css||a.update(b.position))+";"+"}";e.push(f)}),e.push("}"),e.join("\n")}function J(a){if(!a.scrollableScrollbar){var b=a.scrollableScrollbar=document.createElement("div");b.className="scrollability-scrollbar"}return a.scrollableScrollbar}function K(a,b,c,d){return a==d?b+c:c*(-Math.pow(2,-10*a/d)+1)+b}function L(a){var b=a.parentNode,c=getComputedStyle(a).webkitTransform,d=(new WebKitCSSMatrix(c)).m41;return{node:a,min:-a.offsetWidth+b.offsetWidth,max:0,position:d,viewport:b.offsetWidth,bounce:b.offsetWidth*j,constrained:!0,filter:function(a,b){return a},disable:function(a,b,c,d){var e=Math.abs(a-c),f=Math.abs(b-d);if(f>e&&f>i)return!0},update:function(a){return"translate3d("+Math.round(a)+"px, 0, 0)"}}}function M(a){var b=a.parentNode,c=getComputedStyle(a).webkitTransform,d=(new WebKitCSSMatrix(c)).m42;return{node:a,scrollbar:J(a),position:d,min:-a.offsetHeight+b.offsetHeight,max:0,viewport:b.offsetHeight,bounce:b.offsetHeight*j,constrained:!0,filter:function(a,b){return b},disable:function(a,b,c,d){var e=Math.abs(a-c),f=Math.abs(b-d);if(e>f&&e>i)return!0},update:function(a){return"translate3d(0, "+Math.round(a)+"px, 0)"}}}function N(a,b,c){b&&(a.style.webkitAnimation=b+" "+c+"ms linear"),a.style.webkitAnimationPlayState=b?"running":"paused"}function O(a){a.style.webkitTransition="",a.style.opacity="1"}function P(a,b,c){var d=document.createEvent("Events");d.initEvent(a,!0,!0);if(c)for(var a in c)d[a]=c[a];return b.dispatchEvent(d)}"style scrollability/scrollbar.css";var d="webkitTransform"in document.documentElement.style,e=d&&/OS 5_/.exec(navigator.userAgent),f="ontouchstart"in window,g=.9925,h=4,i=10,j=.75,k=.01,l=240,m=140,n=.5,o=2,p=2,q=7,r=4,s=24,t,u,v,w,x,y=0,z=[],A=0,B={horizontal:L,vertical:M};b.directions=B,b.flashIndicators=function(){var a=document.querySelectorAll(".scrollable.vertical");for(var c=0;c<a.length;++c)b.scrollTo(a[c],0,0,20,!0)},a.ready(function(){function b(b){var e=f?b.touches[0]:b;v=t=e.clientX,w=u=e.clientY,x=!1,z=F(b.target,v,w,b.timeStamp);if(!z.length)return!0;a.addEventListener(f?"touchmove":"mousemove",c,!1),a.addEventListener(f?"touchend":"mouseup",d,!1)}function c(a){a.preventDefault(),x=!0;var b=f?a.touches[0]:a;v=b.clientX,w=b.clientY;if(z.length>1)for(var c=0;c<z.length;++c){var d=z[c];d.disable&&d.disable(v,w,t,u)&&(d.terminate(),z.splice(c--,1),z.length==1&&P("scrollability-lock",d.node,{direction:d.direction}))}E(a.timeStamp,!0)}function d(b){a.removeEventListener(f?"touchmove":"mousemove",c,!1),a.removeEventListener(f?"touchend":"mouseup",d,!1),E(b.timeStamp)}var a=document;a.addEventListener(f?"touchstart":"mousedown",b,!1)})})({ready:function(a){a()}},window,{exports:window})}()
->>>>>>> 35bf416a3cee9c4eac75e6734af9cc4aa993ffe5
+(function(){var a=document.createElement("style");a.innerHTML='.scrollable{-webkit-transform:translate3d(0,0,0)}.scrollability-scrollbar{position:absolute;top:0;right:2px;width:7px;height:1px;z-index:2147483647;opacity:0;-webkit-transform:translate3d(0,0,0);-webkit-box-sizing:border-box;-webkit-transform-origin:top left;background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAABCAYAAADuHp8EAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAC5JREFUeNpi/P//vyQDAwMjKytr2Z8/f9gYIICRAQH+Q/n/WVhYfgNBJ4gNEGAAhVUOGMTI0TwAAAAASUVORK5CYII=") no-repeat}',document.head.appendChild(a)})(),function(){(function(a,b,c){function d(){var a=[];a.push.apply(a,arguments),console.log(a.join(" "))}function E(){var a=document.createElement("style");document.head.appendChild(a),C=document.styleSheets[document.styleSheets.length-1]}function F(a){function f(a){a.preventDefault(),y=!0,e&&(clearTimeout(e),e=0),c&&(M(c),c=null);var b=g?a.touches[0]:a;w=b.clientX,x=b.clientY;if(A.length>1)for(var d=0;d<A.length;++d){var f=A[d];if(f.disable&&f.disable(w,x,u,v)){f.terminate(),A.splice(d--,1);if(A.length==1){var h=A[0];T("scrollability-lock",h.node,{direction:h.direction})}}}A.forEach(function(b){var c=b.filter(w,x);b.track(c,a.timeStamp)})}function h(a){if(c){var b=document.createEvent("MouseEvents");b.initMouseEvent("click",!0,!0,window,1),c[0].dispatchEvent(b),M(c)}document.removeEventListener(g?"touchmove":"mousemove",f,!1),document.removeEventListener(g?"touchend":"mouseup",h,!1),A.forEach(function(a){a.takeoff()})}var b=g?a.touches[0]:a,c=null;w=u=b.clientX,x=v=b.clientY,y=!1,A=H(a.target,w,x,a.timeStamp);if(!A.length)return!0;var d=a.target,e=setTimeout(function(){e=0,c=L(d)},50);document.addEventListener(g?"touchmove":"mousemove",f,!1),document.addEventListener(g?"touchend":"mouseup",h,!1)}function G(a,b,c,d){function X(a,b){N.push({node:a,callback:b,keyframes:[]})}function Y(a){D=a}function Z(a){P=a,$(I,J)}function $(a,b){L=b-J,J=b,E=a-I,I=a,Math.abs(E)<i?++M:(M&&--M,M=0);if(f)if(v>x&&A==x){var c=v-x;E*=(1-c/G)*k}else if(v<w&&z==w){var c=w-v;E*=(1-c/G)*k}return v+=E,bc(v),e.style.webkitAnimationName="",N.forEach(function(a){a.node.style.webkitAnimationName=""}),!0}function _(a){var b=-w-x;if(u&&j<b){var c=j-q*2,d=c/b*c,e;if(a>x)d=Math.max(d-(a-x),r),e=0;else if(a<w){var f=d-(w-a);d=Math.max(d-(w-a),r),e=c-d}else e=Math.abs(a)/b*(c-d);return e+=q,"translate3d(0, "+Math.round(e)+"px, 0) "+"scaleY("+Math.round(d)+")"}}function ba(){M&&(E=0),v+=E,bc(v),E=E/L*s;var b=bb();if(!b.time){bf();return}T("scrollability-animate",e,{direction:a.direction,time:b.time,keyframes:b.keyframes}),e.cleanup&&e.cleanup(),C.insertRule(b.css,0),N.forEach(function(c,d){c.name="scrollability-track"+B++;var e=K(a,c.keyframes,c.name,b.time);C.insertRule(e,0)}),e.earlyEnd=function(){be(!0)},e.normalEnd=function(){bd(b.keyframes[b.keyframes.length-1].position),be()},e.cleanup=function(){delete e.cleanup,C.deleteRule(0),N.forEach(function(a){C.deleteRule(0)})},e.addEventListener("webkitAnimationEnd",e.normalEnd,!1),R(e,b.name,b.time),N.forEach(function(a){R(a.node,a.name,b.time)})}function bb(){function Q(a){var f=v-c;if(a||b-d>=t||e<0!=f<0)o.push({position:v,time:b}),N.forEach(function(a){a.keyframes.push({time:b,css:a.callback(v)})}),e=f,c=v,d=b}var b=0,c=v,d=0,e=0,i,k,m=0,n,o=[];if(g)if(Math.abs(v-x)>H||Math.abs(E)>p)if(v>x){if(x!=A){x+=j+D,w+=j+D;var q=w%j,r=-Math.round((v+j-q)/(j+D));T("scrollability-page",a.node,{page:r})}}else if(w!=z){x-=j+D,w-=j+D;var q=w%j,r=-Math.round((v-j-q)/(j+D));T("scrollability-page",a.node,{page:r})}var u=!0;while(u){if(v>x&&f)if(E>0){var y=v-x,C=1-y/G;E=Math.max(E-l,0)*C,v+=E}else m||(i=v,k=x-v),v=O(m,i,k,F),u=++m<=F&&Math.floor(Math.abs(v))>x;else if(v<w&&f)if(E<0){var y=w-v,C=1-y/G;E=Math.min(E+l,0)*C,v+=E}else m||(i=v,k=w-v),v=O(m,i,k,F),u=++m<=F&&Math.ceil(v)<w;else{u=Math.floor(Math.abs(E)*10)>0;if(!u)break;E*=h,v+=E}Q(!u),b+=s}if(g){var I=Math.round(v/(j+D));v=I*(j+D),Q(!0)}else v>x&&f?(v=x,Q(!0)):v<w&&f&&(v=w,Q(!0));var J=o.length?o[o.length-1].time:0,L="scrollability"+B++,M=K(a,o,L,J,P);return{time:J,position:v,keyframes:o,name:L,css:M}}function bc(b){if(!T("scrollability-scroll",e,{direction:a.direction,position:b}))return;bd(b),u&&y&&S(u)}function bd(b){e.style.webkitTransform=a.update(b+P),e.scrollableOffset=P,N.forEach(function(a){a.node.style.webkitTransform=a.callback(b)})}function be(b){u&&(b?S(u):(u.style.opacity="0",u.style.webkitTransition="opacity 0.33s linear")),e.removeEventListener("webkitAnimationEnd",e.normalEnd,!1),delete e.earlyEnd,delete e.normalEnd,a.mute||T("scrollability-end",e)}function bf(){be()}var e=a.node,f=a.constrained,g=a.paginated,j=a.viewport||0,u=a.scrollbar,v=a.position,w=a.min,x=a.max,z=w,A=Math.round(x/j)*j,D=0,E=0,F=g?n:m,G=a.bounce,H=j*o,I=startTouch=a.filter(b,c),J=d,L=0,M=0,N=[],P=e.scrollableOffset||0;if(!a.mute){var Q={position:v,track:X,setSpacing:Y,setOffset:Z};if(!T("scrollability-start",e,Q))return null}if(g){if(D===undefined){var U=Math.round(Math.abs(z)%j),V=(Math.abs(z)-U)/j+1;D=U/V}var W=Math.round(v/(j+D));w=x=W*(j+D),z+=D}return u&&(X(u,_),u.parentNode||e.parentNode.appendChild(u)),e.earlyEnd&&(R(e),N.forEach(function(a){R(a.node)}),e.earlyEnd(),bc(v)),a.reposition=bc,a.track=$,a.takeoff=ba,a.terminate=bf,a}function H(a,b,c,d){var e=[],f=document.querySelectorAll(".scrollable.universal");for(var g=0;g<f.length;++g)I(f[g],e,b,c,d);return f.length||I(a,e,b,c,d),e}function I(a,b,c,d,e){while(a){if(a.nodeType==1){var f=J(a,c,d,e);if(f){var g=!1;for(var h=0;h<b.length;++h)if(b[h].node==a){g=!0;break}g||(f=G(f,c,d,e),f&&b.push(f))}}a=a.parentNode}}function J(a,b,c,d){var e=a.className.split(" ");if(e.indexOf("scrollable")==-1)return;for(var f=0;f<e.length;++f){var g=e[f];if(D[g]){var h=D[g](a);return h.direction=g,h.paginated=e.indexOf("paginated")!=-1,h}}}function K(a,b,c,d,e){var f=["@-webkit-keyframes "+c+" {"];return b.forEach(function(b){var c=b.time/d*100,g=Math.floor(c)+"% {"+"-webkit-transform: "+(b.css||a.update(b.position+e))+";"+"}";f.push(g)}),f.push("}"),f.join("\n")}function L(a){var b=[];for(var c=a;c;c=c.parentNode)c.nodeType==1&&(c.className=(c.className?c.className+" ":"")+"touched",b.push(c));return b}function M(a){for(var b=0;b<a.length;++b){var c=a[b];c.className=c.className.replace("touched","")}}function N(a){if(!a.scrollableScrollbar){var b=a.scrollableScrollbar=document.createElement("div");b.className="scrollability-scrollbar"}return a.scrollableScrollbar}function O(a,b,c,d){return a==d?b+c:c*(-Math.pow(2,-10*a/d)+1)+b}function P(a){var b=a.parentNode,c=a.querySelector(".scrollable > .clipper")||a;a.style.webkitAnimation&&(a.style.webkitAnimationPlayState="paused");var d=getComputedStyle(a).webkitTransform,e=(new WebKitCSSMatrix(d)).m41-(a.scrollableOffset||0);return{node:a,min:-c.offsetWidth+b.offsetWidth,max:0,position:e,viewport:b.offsetWidth,bounce:b.offsetWidth*k,constrained:!0,filter:function(a,b){return a},disable:function(a,b,c,d){var e=Math.abs(a-c),f=Math.abs(b-d);if(f>e&&f>j)return!0},update:function(a){return"translate3d("+Math.round(a)+"px, 0, 0)"}}}function Q(a){var b=a.parentNode,c=a.querySelector(".scrollable > .clipper")||a;a.style.webkitAnimation&&(a.style.webkitAnimationPlayState="paused");var d=getComputedStyle(a).webkitTransform,e=(new WebKitCSSMatrix(d)).m42;return{node:a,scrollbar:N(a),position:e,min:-c.offsetHeight+b.offsetHeight,max:0,viewport:b.offsetHeight,bounce:b.offsetHeight*k,constrained:!0,filter:function(a,b){return b},disable:function(a,b,c,d){var e=Math.abs(a-c),f=Math.abs(b-d);if(e>f&&e>j)return!0},update:function(a){return"translate3d(0, "+Math.round(a)+"px, 0)"}}}function R(a,b,c){b&&(a.style.webkitAnimation=b+" "+c+"ms linear both"),a.style.webkitAnimationPlayState=b?"running":"paused"}function S(a){a.style.webkitTransition="",a.style.opacity="1"}function T(a,b,c){var d=document.createEvent("Events");d.initEvent(a,!1,!0);if(c)for(var a in c)d[a]=c[a];return b.dispatchEvent(d)}"style scrollability/scrollbar.css";var e="webkitTransform"in document.documentElement.style,f=e&&/OS 5_/.exec(navigator.userAgent),g="ontouchstart"in window,h=.9925,i=4,j=10,k=.75,l=.01,m=240,n=160,o=.5,p=2,q=2,r=7,s=4,t=24,u,v,w,x,y,z=0,A=[],B=0,C,D={horizontal:P,vertical:Q};b.directions=D,b.flashIndicators=function(){},a.ready(function(){document.addEventListener(g?"touchstart":"mousedown",F,!1),window.addEventListener("load",E,!1)})})({ready:function(a){a()}},window,{exports:window})}()

0 comments on commit 6498c4d

Please sign in to comment.