var _____WB$wombat$assign$function_____ = function(name) {return (self._wb_wombat && self._wb_wombat.local_init && self._wb_wombat.local_init(name)) || self[name]; }; if (!self.__WB_pmw) { self.__WB_pmw = function(obj) { this.__WB_source = obj; return this; } } { let window = _____WB$wombat$assign$function_____("window"); let self = _____WB$wombat$assign$function_____("self"); let document = _____WB$wombat$assign$function_____("document"); let location = _____WB$wombat$assign$function_____("location"); let top = _____WB$wombat$assign$function_____("top"); let parent = _____WB$wombat$assign$function_____("parent"); let frames = _____WB$wombat$assign$function_____("frames"); let opener = _____WB$wombat$assign$function_____("opener"); ASPxScrollingManager = _aspxCreateClass(null, { constructor: function(owner, scrollableArea, orientation, onBeforeScrolling, onAfterScrolling, forseEmulation) { this.owner = owner; this.scrollableArea = scrollableArea; this.orientation = orientation; this.animationDelay = 1; this.animationStep = 2; this.animationOffset = 5; this.animationAcceleration = 0; this.scrollSessionInterval = 10; this.stopScrolling = true; this.busy = false; this.currentAcceleration = 0; this.startPos; this.onBeforeScrolling = onBeforeScrolling; this.onAfterScrolling = onAfterScrolling; this.emulationMode = forseEmulation === true || !__aspxTouchUI; this.Initialize(); }, Initialize: function(){ if(this.emulationMode){ this.wrapper = new ASPxScrollingManager.scrollWrapper(this.scrollableArea); } else { this.wrapper = new ASPxScrollingManager.scrollWrapperTouchUI(this.scrollableArea, function(direction){ if(this.onAfterScrolling) this.onAfterScrolling(this, direction); }.aspxBind(this)); } }, GetScrolledAreaPosition: function() { return this.wrapper.GetScrollLeft() * this.orientation[0] + this.wrapper.GetScrollTop() * this.orientation[1]; }, SetScrolledAreaPosition: function(pos) { this.wrapper.SetScrollLeft(pos * this.orientation[0]); this.wrapper.SetScrollTop(pos * this.orientation[1]); }, PrepareForScrollAnimation: function() { if(!this.scrollableArea) return; this.currentAcceleration = 0; this.startPos = this.GetScrolledAreaPosition(); this.busy = false; }, GetAnimationStep: function(dir) { var step = dir * (this.animationStep + this.currentAcceleration); var newPos = this.GetScrolledAreaPosition() + step; var requiredPos = this.startPos + dir * this.animationOffset; if((dir == 1 && newPos >= requiredPos) || (dir == -1 && newPos <= requiredPos)) { step = requiredPos - this.GetScrolledAreaPosition(); } return step; }, DoScrollSessionAnimation: function(direction) { if(!this.scrollableArea) return; this.SetScrolledAreaPosition(this.GetScrolledAreaPosition() + this.GetAnimationStep(direction)); var self = this; if(!this.ShouldStopScrollSessionAnimation()) { this.busy = true; this.currentAcceleration += this.animationAcceleration; _aspxSetTimeout(function() { self.DoScrollSessionAnimation(direction); }, this.animationDelay); } else { if(this.onAfterScrolling) this.onAfterScrolling(this, -direction); this.busy = false; this.currentAcceleration = 0; _aspxSetTimeout(function() { self.DoScroll(direction); }, this.scrollSessionInterval); } }, ShouldStopScrollSessionAnimation: function() { return (Math.abs(this.GetScrolledAreaPosition() - this.startPos) >= Math.abs(this.animationOffset)); }, DoScroll: function(direction) { if(!this.scrollableArea) return; if(!this.busy && !this.stopScrolling) { if(this.onBeforeScrolling) this.onBeforeScrolling(this, -direction); if(this.stopScrolling) return; this.PrepareForScrollAnimation(); this.DoScrollSessionAnimation(direction); } }, StartScrolling: function(direction, delay, step) { this.stopScrolling = false; this.animationDelay = delay; this.animationStep = step; this.DoScroll(-direction); }, StopScrolling: function() { this.stopScrolling = true; }, IsStopped: function() { return this.stopScrolling; } }); (function(){ ASPxScrollingManager.scrollWrapper = function(scrollableArea){ this.scrollableArea = scrollableArea; this.Initialize(); }; ASPxScrollingManager.scrollWrapper.prototype = { Initialize: function(){ this.scrollableArea.style.position = "relative"; this.scrollableArea.parentNode.style.position = "relative"; }, GetScrollLeft: function(){ return _aspxPxToInt(this.scrollableArea.style.left); }, GetScrollTop: function(){ return _aspxPxToInt(this.scrollableArea.style.top); }, SetScrollLeft: function(value){ this.scrollableArea.style.left = value + "px"; }, SetScrollTop: function(value){ this.scrollableArea.style.top = value + "px"; } }; ASPxScrollingManager.scrollWrapperTouchUI = function(scrollableArea, onScroll){ this.scrollableArea = scrollableArea; this.scrollTimerId = -1; this.onScroll = onScroll; this.Initialize(onScroll); }; ASPxScrollingManager.scrollWrapperTouchUI.prototype = { Initialize: function(){ var div = this.scrollableArea.parentNode; this.onScrollCore = function(){ _aspxClearTimer(this.scrollTimerId); if(this.onScrollLocked) return; this.scrollTimerId = window.setTimeout(this.onScrollByTimer, 1000); }.aspxBind(this); this.onScrollByTimer = function(){ if(this.onScrollLocked) return; var direction = this.lastScrollTop < div.scrollTop ? 1 : -1; this.lastScrollTop = div.scrollTop; this.onScrollLocked = true; this.onScroll(direction); this.onScrollLocked = false; }.aspxBind(this); this.lastScrollTop = div.scrollTop; var onscroll = ASPxClientTouchUI.nativeScrollingSupported() ? this.onScrollCore : this.onScrollByTimer; _aspxAttachEventToElement(div, "scroll", onscroll); this.scrollExtender = ASPxClientTouchUI.MakeScrollable(div, {showHorizontalScrollbar: false}); }, GetScrollLeft: function(){ return -this.scrollableArea.parentNode.scrollLeft; }, GetScrollTop: function(){ return -this.scrollableArea.parentNode.scrollTop; }, SetScrollLeft: function(value){ this.onScrollLocked = true; this.scrollableArea.parentNode.scrollLeft = -value; this.onScrollLocked = false; }, SetScrollTop: function(value){ this.onScrollLocked = true; this.scrollableArea.parentNode.scrollTop = -value; this.onScrollLocked = false; } }; })(); } /* playback timings (ms): captures_list: 60.894 exclusion.robots: 0.126 exclusion.robots.policy: 0.116 RedisCDXSource: 0.784 esindex: 0.01 LoadShardBlock: 35.16 (3) PetaboxLoader3.datanode: 58.268 (4) CDXLines.iter: 21.935 (3) load_resource: 63.637 PetaboxLoader3.resolve: 23.791 */