Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Removing unused files.

  • Loading branch information...
commit 057a2f888d617f3987324f2abac8fe5c433f903d 1 parent deaf272
@doctyper doctyper authored
Showing with 0 additions and 14 deletions.
  1. +0 −14 red/modules/scroller/zynga/scroller.min.js
View
14 red/modules/scroller/zynga/scroller.min.js
@@ -1,14 +0,0 @@
-/*
- * Scroller
- * http://github.com/zynga/scroller
- *
- * Copyright 2011, Zynga Inc.
- * Licensed under the MIT License.
- * https://raw.github.com/zynga/scroller/master/MIT-LICENSE.txt
- *
- * Based on the work of: Unify Project (unify-project.org)
- * http://unify-project.org
- * Copyright 2011, Deutsche Telekom AG
- * License: MIT + Apache (V2)
- */
- var Scroller;(function(){Scroller=function(a,b){this.__callback=a,this.options={scrollingX:!0,scrollingY:!0,animating:!0,bouncing:!0,locking:!0,paging:!1,snapping:!1,zooming:!1,minZoom:.5,maxZoom:3};for(var c in b)this.options[c]=b[c]};var a=function(a){return Math.pow(a-1,3)+1},b=function(a){return(a/=.5)<1?.5*Math.pow(a,3):.5*(Math.pow(a-2,3)+2)},c={__isSingleTouch:!1,__isTracking:!1,__isGesturing:!1,__isDragging:!1,__isDecelerating:!1,__isAnimating:!1,__clientLeft:0,__clientTop:0,__clientWidth:0,__clientHeight:0,__contentWidth:0,__contentHeight:0,__snapWidth:100,__snapHeight:100,__refreshHeight:null,__refreshActive:!1,__refreshActivate:null,__refreshDeactivate:null,__refreshStart:null,__zoomLevel:1,__scrollLeft:0,__scrollTop:0,__maxScrollLeft:0,__maxScrollTop:0,__scheduledLeft:0,__scheduledTop:0,__scheduledZoom:0,__lastTouchLeft:null,__lastTouchTop:null,__lastTouchMove:null,__positions:null,__minDecelerationScrollLeft:null,__minDecelerationScrollTop:null,__maxDecelerationScrollLeft:null,__maxDecelerationScrollTop:null,__decelerationVelocityX:null,__decelerationVelocityY:null,setDimensions:function(a,b,c,d){var e=this;a&&(e.__clientWidth=a),b&&(e.__clientHeight=b),c&&(e.__contentWidth=c),d&&(e.__contentHeight=d),e.__computeScrollMax(),e.scrollTo(e.__scrollLeft,e.__scrollTop,!0)},setPosition:function(a,b){var c=this;c.__clientLeft=a||0,c.__clientTop=b||0},setSnapSize:function(a,b){var c=this;c.__snapWidth=a,c.__snapHeight=b},activatePullToRefresh:function(a,b,c,d){var e=this;e.__refreshHeight=a,e.__refreshActivate=b,e.__refreshDeactivate=c,e.__refreshStart=d},finishPullToRefresh:function(){var a=this;a.__refreshActive=!1,a.__refreshDeactivate&&a.__refreshDeactivate(),a.scrollTo(a.__scrollLeft,a.__scrollTop,!0)},getValues:function(){var a=this;return{left:a.__scrollLeft,top:a.__scrollTop,zoom:a.__zoomLevel}},getScrollMax:function(){var a=this;return{left:a.__maxScrollLeft,top:a.__maxScrollTop}},zoomTo:function(a,b,c,d){var e=this;if(!e.options.zooming)throw new Error("Zooming is not enabled!");e.__isDecelerating&&(Scroller.effect.Animate.stop(e.__isDecelerating),e.__isDecelerating=!1);var f=e.__zoomLevel;c||(c=e.__clientWidth/2),d||(d=e.__clientHeight/2),a=Math.max(Math.min(a,e.options.maxZoom),e.options.minZoom),e.__computeScrollMax(a);var g=(c+e.__scrollLeft)*a/f-c,h=(d+e.__scrollTop)*a/f-d;g>e.__maxScrollLeft?g=e.__maxScrollLeft:g<0&&(g=0),h>e.__maxScrollTop?h=e.__maxScrollTop:h<0&&(h=0),e.__publish(g,h,a,b)},zoomBy:function(a,b,c,d){var e=this;e.zoomTo(e.__zoomLevel*a,b,c,d)},scrollTo:function(a,b,c,d){var e=this;e.__isDecelerating&&(Scroller.effect.Animate.stop(e.__isDecelerating),e.__isDecelerating=!1);if(d&&d!==e.__zoomLevel){if(!e.options.zooming)throw new Error("Zooming is not enabled!");a*=d,b*=d,e.__computeScrollMax(d)}else d=e.__zoomLevel;e.options.scrollingX?e.options.paging?a=Math.round(a/e.__clientWidth)*e.__clientWidth:e.options.snapping&&(a=Math.round(a/e.__snapWidth)*e.__snapWidth):a=e.__scrollLeft,e.options.scrollingY?e.options.paging?b=Math.round(b/e.__clientHeight)*e.__clientHeight:e.options.snapping&&(b=Math.round(b/e.__snapHeight)*e.__snapHeight):b=e.__scrollTop,a=Math.max(Math.min(e.__maxScrollLeft,a),0),b=Math.max(Math.min(e.__maxScrollTop,b),0),a===e.__scrollLeft&&b===e.__scrollTop&&(c=!1),e.__publish(a,b,d,c)},scrollBy:function(a,b,c){var d=this,e=d.__isAnimating?d.__scheduledLeft:d.__scrollLeft,f=d.__isAnimating?d.__scheduledTop:d.__scrollTop;d.scrollTo(e+(a||0),f+(b||0),c)},doMouseZoom:function(a,b,c,d){var e=this,f=a>0?.97:1.03;return e.zoomTo(e.__zoomLevel*f,!1,c-e.__clientLeft,d-e.__clientTop)},doTouchStart:function(a,b){if(!a.length)throw new Error("Invalid touch list: "+a);b instanceof Date&&(b=b.valueOf());if(typeof b!="number")throw new Error("Invalid timestamp value: "+b);var c=this;c.__isDecelerating&&(Scroller.effect.Animate.stop(c.__isDecelerating),c.__isDecelerating=!1),c.__isAnimating&&(Scroller.effect.Animate.stop(c.__isAnimating),c.__isAnimating=!1);var d,e,f=a.length===1;f?(d=a[0].pageX,e=a[0].pageY):(d=Math.abs(a[0].pageX+a[1].pageX)/2,e=Math.abs(a[0].pageY+a[1].pageY)/2),c.__initialTouchLeft=d,c.__initialTouchTop=e,c.__zoomLevelStart=c.__zoomLevel,c.__lastTouchLeft=d,c.__lastTouchTop=e,c.__lastTouchMove=b,c.__lastScale=1,c.__enableScrollX=!f&&c.options.scrollingX,c.__enableScrollY=!f&&c.options.scrollingY,c.__isTracking=!0,c.__isDragging=!f,c.__isSingleTouch=f,c.__positions=[]},doTouchMove:function(a,b,c){if(!a.length)throw new Error("Invalid touch list: "+a);b instanceof Date&&(b=b.valueOf());if(typeof b!="number")throw new Error("Invalid timestamp value: "+b);var d=this;if(!d.__isTracking)return;var e,f;a.length===2?(e=Math.abs(a[0].pageX+a[1].pageX)/2,f=Math.abs(a[0].pageY+a[1].pageY)/2):(e=a[0].pageX,f=a[0].pageY);var g=d.__positions;if(d.__isDragging){var h=e-d.__lastTouchLeft,i=f-d.__lastTouchTop,j=d.__scrollLeft,k=d.__scrollTop,l=d.__zoomLevel;if(c&&d.options.zooming){var m=l;l=l/d.__lastScale*c,l=Math.max(Math.min(l,d.options.maxZoom),d.options.minZoom);if(m!==l){var n=e-d.__clientLeft,o=f-d.__clientTop;j=(n+j)*l/m-n,k=(o+k)*l/m-o,d.__computeScrollMax(l)}}if(d.__enableScrollX){j-=h;var p=d.__maxScrollLeft;if(j>p||j<0)d.options.bouncing?j+=h/2:j>p?j=p:j=0}if(d.__enableScrollY){k-=i;var q=d.__maxScrollTop;if(k>q||k<0)d.options.bouncing?(k+=i/2,!d.__enableScrollX&&d.__refreshHeight&&(!d.__refreshActive&&k<=-d.__refreshHeight?(d.__refreshActive=!0,d.__refreshActivate&&d.__refreshActivate()):d.__refreshActive&&k>-d.__refreshHeight&&(d.__refreshActive=!1,d.__refreshDeactivate&&d.__refreshDeactivate()))):k>q?k=q:k=0}g.length>60&&g.splice(0,30),g.push(j,k,b),d.__publish(j,k,l)}else{var r=d.options.locking?3:0,s=5,t=Math.abs(e-d.__initialTouchLeft),u=Math.abs(f-d.__initialTouchTop);d.__enableScrollX=d.options.scrollingX&&t>=r,d.__enableScrollY=d.options.scrollingY&&u>=r,g.push(d.__scrollLeft,d.__scrollTop,b),d.__isDragging=(d.__enableScrollX||d.__enableScrollY)&&(t>=s||u>=s)}d.__lastTouchLeft=e,d.__lastTouchTop=f,d.__lastTouchMove=b,d.__lastScale=c},doTouchEnd:function(a){a instanceof Date&&(a=a.valueOf());if(typeof a!="number")throw new Error("Invalid timestamp value: "+a);var b=this;if(!b.__isTracking)return;b.__isTracking=!1;if(b.__isDragging){b.__isDragging=!1;if(b.__isSingleTouch&&b.options.animating&&a-b.__lastTouchMove<=100){var c=b.__positions,d=c.length-1,e=d;for(var f=d;f>0&&c[f]>b.__lastTouchMove-100;f-=3)e=f;if(e!==d){var g=c[d]-c[e],h=b.__scrollLeft-c[e-2],i=b.__scrollTop-c[e-1];b.__decelerationVelocityX=h/g*(1e3/60),b.__decelerationVelocityY=i/g*(1e3/60);var j=b.options.paging||b.options.snapping?4:1;if(Math.abs(b.__decelerationVelocityX)>j||Math.abs(b.__decelerationVelocityY)>j)b.__refreshActive||b.__startDeceleration(a)}}}b.__isDecelerating||(b.__refreshActive&&b.__refreshStart?(b.__publish(b.__scrollLeft,-b.__refreshHeight,b.__zoomLevel,!0),b.__refreshStart&&b.__refreshStart()):(b.scrollTo(b.__scrollLeft,b.__scrollTop,!0,b.__zoomLevel),b.__refreshActive&&(b.__refreshActive=!1,b.__refreshDeactivate&&b.__refreshDeactivate()))),b.__positions.length=0},__publish:function(c,d,e,f){var g=this,h=g.__isAnimating;h&&(Scroller.effect.Animate.stop(h),g.__isAnimating=!1);if(f&&g.options.animating){g.__scheduledLeft=c,g.__scheduledTop=d,g.__scheduledZoom=e;var i=g.__scrollLeft,j=g.__scrollTop,k=g.__zoomLevel,l=c-i,m=d-j,n=e-k,o=function(a,b,c){c&&(g.__scrollLeft=i+l*a,g.__scrollTop=j+m*a,g.__zoomLevel=k+n*a,g.__callback&&g.__callback(g.__scrollLeft,g.__scrollTop,g.__zoomLevel))},p=function(a){return g.__isAnimating===a},q=function(a,b,c){b===g.__isAnimating&&(g.__isAnimating=!1),g.options.zooming&&g.__computeScrollMax()};g.__isAnimating=Scroller.effect.Animate.start(o,p,q,250,h?a:b)}else g.__scheduledLeft=g.__scrollLeft=c,g.__scheduledTop=g.__scrollTop=d,g.__scheduledZoom=g.__zoomLevel=e,g.__callback&&g.__callback(c,d,e),g.options.zooming&&g.__computeScrollMax()},__computeScrollMax:function(a){var b=this;a||(a=b.__zoomLevel),b.__maxScrollLeft=Math.max(b.__contentWidth*a-b.__clientWidth,0),b.__maxScrollTop=Math.max(b.__contentHeight*a-b.__clientHeight,0)},__startDeceleration:function(a){var b=this;if(b.options.paging){var c=Math.max(Math.min(b.__scrollLeft,b.__maxScrollLeft),0),d=Math.max(Math.min(b.__scrollTop,b.__maxScrollTop),0),e=b.__clientWidth,f=b.__clientHeight;b.__minDecelerationScrollLeft=Math.floor(c/e)*e,b.__minDecelerationScrollTop=Math.floor(d/f)*f,b.__maxDecelerationScrollLeft=Math.ceil(c/e)*e,b.__maxDecelerationScrollTop=Math.ceil(d/f)*f}else b.__minDecelerationScrollLeft=0,b.__minDecelerationScrollTop=0,b.__maxDecelerationScrollLeft=b.__maxScrollLeft,b.__maxDecelerationScrollTop=b.__maxScrollTop;var g=function(a,c,d){b.__stepThroughDeceleration(d)},h=b.options.snapping?4:.1,i=function(){return Math.abs(b.__decelerationVelocityX)>=h||Math.abs(b.__decelerationVelocityY)>=h},j=function(a,c,d){b.__isDecelerating=!1,b.scrollTo(b.__scrollLeft,b.__scrollTop,b.options.snapping)};b.__isDecelerating=Scroller.effect.Animate.start(g,i,j)},__stepThroughDeceleration:function(a){var b=this,c=b.__scrollLeft+b.__decelerationVelocityX,d=b.__scrollTop+b.__decelerationVelocityY;if(!b.options.bouncing){var e=Math.max(Math.min(b.__maxScrollLeft,c),0);e!==c&&(c=e,b.__decelerationVelocityX=0);var f=Math.max(Math.min(b.__maxScrollTop,d),0);f!==d&&(d=f,b.__decelerationVelocityY=0)}a?b.__publish(c,d,b.__zoomLevel):(b.__scrollLeft=c,b.__scrollTop=d);if(!b.options.paging){var g=.95;b.__decelerationVelocityX*=g,b.__decelerationVelocityY*=g}if(b.options.bouncing){var h=0,i=0,j=.03,k=.08;c<b.__minDecelerationScrollLeft?h=b.__minDecelerationScrollLeft-c:c>b.__maxDecelerationScrollLeft&&(h=b.__maxDecelerationScrollLeft-c),d<b.__minDecelerationScrollTop?i=b.__minDecelerationScrollTop-d:d>b.__maxDecelerationScrollTop&&(i=b.__maxDecelerationScrollTop-d),h!==0&&(h*b.__decelerationVelocityX<=0?b.__decelerationVelocityX+=h*j:b.__decelerationVelocityX=h*k),i!==0&&(i*b.__decelerationVelocityY<=0?b.__decelerationVelocityY+=i*j:b.__decelerationVelocityY=i*k)}}};for(var d in c)Scroller.prototype[d]=c[d]})(),function(a){if(a.requestAnimationFrame)return;var b=Date.now||function(){return(new Date).getTime()},c=Object.keys||function(a){var b={};for(var c in a)b[c]=!0;return b},d=Object.empty||function(a){for(var b in a)return!1;return!0},e=60,f={},g=1,h=null;a.requestAnimationFrame=function(a,d){var i=g++;return f[i]=a,h===null&&(h=setTimeout(function(){var a=b(),d=f,e=c(d);f={},h=null;for(var g=0,i=e.length;g<i;g++)d[e[g]](a)},1e3/e)),i},a.cancelRequestAnimationFrame=function(a){delete f[a],d(f)&&(clearTimeout(h),h=null)}}(Scroller),function(a){var b=Date.now||function(){return+(new Date)},c=60,d=1e3,e={},f=1;a.effect||(a.effect={}),a.effect.Animate={stop:function(a){var b=e[a]!==null;return b&&(e[a]=null),b},isRunning:function(a){return e[a]!==null},start:function(g,h,i,j,k,l){var m=b(),n=m,o=0,p=0,q=f++;l||(l=document.body);if(q%20===0){var r={};for(var s in e)r[s]=!0;e=r}var t=function(f){var r=f!==!0,s=b();if(!e[q]||h&&!h(q)){e[q]=null,i&&i(c-p/((s-m)/d),q,!1);return}if(r){var u=Math.round((s-n)/(d/c))-1;for(var v=0;v<Math.min(u,4);v++)t(!0),p++}j&&(o=(s-m)/j,o>1&&(o=1));var w=k?k(o):o;g(w,s,r)!==!1&&o!==1||!r?r&&(n=s,a.requestAnimationFrame(t,l)):(e[q]=null,i&&i(c-p/((s-m)/d),q,o===1||j===null))};return e[q]=!0,a.requestAnimationFrame(t,l),q}}}(Scroller);
Please sign in to comment.
Something went wrong with that request. Please try again.