// UpdateControls.js // Copyright (c) Nikhil Kothari, 2007 // http://www.nikhilk.net // // This product's copyrights are licensed under the Creative // Commons Attribution-ShareAlike (version 2.5).B // http://creativecommons.org/licenses/by-sa/2.5/ // // You are free to: // - copy, distribute, display, and perform the work // - make derivative works // - make commercial use of the work // Under the following conditions: // Attribution. You must attribute the original work in your // product or release. // Share Alike. If you alter, transform, or build upon this work, // you may distribute the resulting work only under // a license identical to this one. // Type.registerNamespace('nStuff'); //////////////////////////////////////////////////////////////////////////////// // nStuff.UpdateAnimationType nStuff.UpdateAnimationType = function() { }; nStuff.UpdateAnimationType.prototype = { crossFade: 0, highlight: 1, slideUp: 2, slideDown: 3, wipeLeft: 4, wipeRight: 5 } nStuff.UpdateAnimationType.registerEnum('nStuff.UpdateAnimationType', false); //////////////////////////////////////////////////////////////////////////////// // nStuff.UpdateAnimation nStuff.$create_UpdateAnimation = function nStuff_UpdateAnimation() { return {}; } //////////////////////////////////////////////////////////////////////////////// // nStuff.UpdateScrollOffset nStuff.UpdateScrollOffset = function() { }; nStuff.UpdateScrollOffset.prototype = { top: 0, bottom: 1, middle: 2 } nStuff.UpdateScrollOffset.registerEnum('nStuff.UpdateScrollOffset', false); //////////////////////////////////////////////////////////////////////////////// // nStuff.UpdateActionOptions nStuff.$create_UpdateActionOptions = function nStuff_UpdateActionOptions() { return {}; } //////////////////////////////////////////////////////////////////////////////// // nStuff.UpdateHistoryOptions nStuff.$create_UpdateHistoryOptions = function nStuff_UpdateHistoryOptions() { return {}; } //////////////////////////////////////////////////////////////////////////////// // nStuff.AnimatedUpdatePanel nStuff.AnimatedUpdatePanel = function nStuff_AnimatedUpdatePanel(element) { nStuff.AnimatedUpdatePanel.initializeBase(this, [ element ]); } nStuff.AnimatedUpdatePanel.prototype = { _animation$2: null, _pageLoadedHandler$2: null, _pageLoadingHandler$2: null, _updatePanel$2: null, _oldUpdatePanel$2: null, get_animation: function nStuff_AnimatedUpdatePanel$get_animation() { return null; }, set_animation: function nStuff_AnimatedUpdatePanel$set_animation(value) { this._animation$2 = value; return value; }, dispose: function nStuff_AnimatedUpdatePanel$dispose() { if (this._pageLoadedHandler$2) { var prm = Sys.WebForms.PageRequestManager.getInstance(); prm.remove_pageLoaded(this._pageLoadedHandler$2); prm.remove_pageLoading(this._pageLoadingHandler$2); this._pageLoadedHandler$2 = null; this._pageLoadingHandler$2 = null; } nStuff.AnimatedUpdatePanel.callBaseMethod(this, 'dispose'); }, initialize: function nStuff_AnimatedUpdatePanel$initialize() { nStuff.AnimatedUpdatePanel.callBaseMethod(this, 'initialize'); this._pageLoadedHandler$2 = Function.createDelegate(this, this._onPageLoaded$2); this._pageLoadingHandler$2 = Function.createDelegate(this, this._onPageLoading$2); var prm = Sys.WebForms.PageRequestManager.getInstance(); prm.add_pageLoaded(this._pageLoadedHandler$2); prm.add_pageLoading(this._pageLoadingHandler$2); var element = this.get_element(); var childNodes = element.childNodes; for (var i = childNodes.length - 1; i >= 0; i--) { if (childNodes[i].nodeType === 1) { this._updatePanel$2 = childNodes[i]; element.style.width = this._updatePanel$2.offsetWidth + 'px'; element.style.height = this._updatePanel$2.offsetHeight + 'px'; var updatePanelStyle = this._updatePanel$2.style; updatePanelStyle.position = 'absolute'; updatePanelStyle.left = '0px'; updatePanelStyle.top = '0px'; break; } } }, _onPageLoaded$2: function nStuff_AnimatedUpdatePanel$_onPageLoaded$2(sender, e) { if (!Array.contains(e.get_panelsUpdated(), this._updatePanel$2)) { return; } var element = this.get_element(); element.style.width = this._updatePanel$2.offsetWidth + 'px'; element.style.height = this._updatePanel$2.offsetHeight + 'px'; if (this._animation$2.type === nStuff.UpdateAnimationType.highlight) { var overlay = document.createElement('div'); overlay.className = this._animation$2.highlightCssClass; var overlayStyle = overlay.style; overlayStyle.display = 'none'; overlayStyle.position = 'absolute'; overlayStyle.top = '0px'; overlayStyle.left = '0px'; overlayStyle.width = element.offsetWidth + 'px'; overlayStyle.height = element.offsetHeight + 'px'; element.appendChild(overlay); var effect = new nStuff._updateHighlight(overlay, this._animation$2.duration); effect.play(); } else { this._oldUpdatePanel$2.style.width = this._updatePanel$2.offsetWidth + 'px'; this._oldUpdatePanel$2.style.height = this._updatePanel$2.offsetHeight + 'px'; var updatePanelStyle = this._updatePanel$2.style; updatePanelStyle.position = 'absolute'; updatePanelStyle.left = '0px'; updatePanelStyle.top = '0px'; if (this._animation$2.type === nStuff.UpdateAnimationType.crossFade) { var effect = new nStuff._updateCrossFade(element, this._animation$2.duration); effect.playEffect(this._oldUpdatePanel$2, this._updatePanel$2); } else { var effect = new nStuff._updateWipeOrSlide(element, this._animation$2.duration); effect.playEffect(this._animation$2.type, this._oldUpdatePanel$2, this._updatePanel$2); } } }, _onPageLoading$2: function nStuff_AnimatedUpdatePanel$_onPageLoading$2(sender, e) { if (!Array.contains(e.get_panelsUpdating(), this._updatePanel$2)) { return; } if (this._animation$2.type !== nStuff.UpdateAnimationType.highlight) { this._oldUpdatePanel$2 = this._updatePanel$2; this._updatePanel$2 = document.createElement(this._oldUpdatePanel$2.tagName); this._updatePanel$2.className = this._oldUpdatePanel$2.className; this._updatePanel$2.id = this._oldUpdatePanel$2.id; this._updatePanel$2.style.visibility = 'hidden'; this._oldUpdatePanel$2.id = ''; this._oldUpdatePanel$2.style.overflow = 'hidden'; var oldHTML = this._oldUpdatePanel$2.innerHTML; sender._destroyTree(this._oldUpdatePanel$2); this._oldUpdatePanel$2.innerHTML = oldHTML; this.get_element().appendChild(this._updatePanel$2); } } } //////////////////////////////////////////////////////////////////////////////// // nStuff._updateScroll nStuff._updateScroll = function nStuff__updateScroll(domElement, duration) { nStuff._updateScroll.initializeBase(this, [ domElement, duration ]); this.set_easingFunction(Function.createDelegate(null, ScriptFX.UI.TimedAnimation.easeInOut)); } nStuff._updateScroll.prototype = { _offsetX$2: 0, _offsetY$2: 0, _scrollXDelta$2: 0, _scrollYDelta$2: 0, performTweening: function nStuff__updateScroll$performTweening(frame) { var scrollX = Math.ceil(frame * this._scrollXDelta$2) + this._offsetX$2; var scrollY = Math.ceil(frame * this._scrollYDelta$2) + this._offsetY$2; window.scrollTo(scrollX, scrollY); }, playEffect: function nStuff__updateScroll$playEffect(scrollToX, scrollToY) { this._offsetX$2 = document.body.scrollLeft; this._offsetY$2 = document.body.scrollTop; this._scrollXDelta$2 = scrollToX - this._offsetX$2; this._scrollYDelta$2 = scrollToY - this._offsetY$2; this.play(); } } //////////////////////////////////////////////////////////////////////////////// // nStuff.UpdateAction nStuff.UpdateAction = function nStuff_UpdateAction() { nStuff.UpdateAction.initializeBase(this); } nStuff.UpdateAction.prototype = { _appLoadHandler$1: null, _beginRequestHandler$1: null, _endRequestHandler$1: null, _options$1: null, _updateOptions$1: null, _scrollLeft$1: 0, _scrollTop$1: 0, get_options: function nStuff_UpdateAction$get_options() { return this._options$1; }, set_options: function nStuff_UpdateAction$set_options(value) { this._options$1 = value; return value; }, dispose: function nStuff_UpdateAction$dispose() { if (this._endRequestHandler$1) { Sys.WebForms.PageRequestManager.getInstance().remove_endRequest(this._endRequestHandler$1); this._endRequestHandler$1 = null; } if (this._beginRequestHandler$1) { Sys.WebForms.PageRequestManager.getInstance().remove_beginRequest(this._beginRequestHandler$1); this._beginRequestHandler$1 = null; } nStuff.UpdateAction.callBaseMethod(this, 'dispose'); }, initialize: function nStuff_UpdateAction$initialize() { nStuff.UpdateAction.callBaseMethod(this, 'initialize'); this._appLoadHandler$1 = Function.createDelegate(this, this._onAppLoad$1); Sys.Application.add_load(this._appLoadHandler$1); }, _onAppLoad$1: function nStuff_UpdateAction$_onAppLoad$1(sender, e) { Sys.Application.remove_load(this._appLoadHandler$1); this._appLoadHandler$1 = null; this._endRequestHandler$1 = Function.createDelegate(this, this._onPageRequestManagerEndRequest$1); Sys.WebForms.PageRequestManager.getInstance().add_endRequest(this._endRequestHandler$1); this._beginRequestHandler$1 = Function.createDelegate(this, this._onPageRequestManagerBeginRequest$1); Sys.WebForms.PageRequestManager.getInstance().add_beginRequest(this._beginRequestHandler$1); this._performActionsCore$1(this._options$1, false); }, _onPageRequestManagerBeginRequest$1: function nStuff_UpdateAction$_onPageRequestManagerBeginRequest$1(sender, e) { Sys.WebForms.PageRequestManager.getInstance()._scrollPosition = null; Sys.WebForms.PageRequestManager.getInstance()._controlIDToFocus = null; if (this._options$1.maintainScrollPosition) { this._scrollLeft$1 = document.body.scrollLeft; this._scrollTop$1 = document.body.scrollTop; } }, _onPageRequestManagerEndRequest$1: function nStuff_UpdateAction$_onPageRequestManagerEndRequest$1(sender, e) { this._updateOptions$1 = e.get_dataItems()[this._options$1.dataID]; if (this._updateOptions$1) { window.setTimeout(Function.createDelegate(this, this._performActions$1), 100); } }, _performActions$1: function nStuff_UpdateAction$_performActions$1() { this._performActionsCore$1(this._updateOptions$1, true); }, _performActionsCore$1: function nStuff_UpdateAction$_performActionsCore$1(options, update) { if (update) { if (options.scrollToID) { var scrollToElement = $get(options.scrollToID); if (scrollToElement) { var location = Sys.UI.DomElement.getLocation(scrollToElement); var offset = 0; if (options.scrollOffset === nStuff.UpdateScrollOffset.bottom) { offset = scrollToElement.offsetHeight; } else if (options.scrollOffset === nStuff.UpdateScrollOffset.middle) { offset = Math.floor(scrollToElement.offsetHeight / 2); } var scroll = new nStuff._updateScroll(document.body, 1000); scroll.playEffect(location.x, location.y + offset); } } else if (options.maintainScrollPosition) { window.scrollTo(this._scrollLeft$1, this._scrollTop$1); } } if (options.message) { alert(options.message); } if (options.focusID) { window.WebForm_AutoFocus(options.focusID); } } } //////////////////////////////////////////////////////////////////////////////// // nStuff._updateWipeOrSlide nStuff._updateWipeOrSlide = function nStuff__updateWipeOrSlide(domElement, duration) { nStuff._updateWipeOrSlide.initializeBase(this, [ domElement, duration ]); this.set_easingFunction(Function.createDelegate(null, ScriptFX.UI.TimedAnimation.easeInOut)); } nStuff._updateWipeOrSlide.prototype = { _animation$2: 0, _oldContent$2: null, _newContent$2: null, _height$2: 0, _width$2: 0, performCleanup: function nStuff__updateWipeOrSlide$performCleanup() { this._oldContent$2.parentNode.removeChild(this._oldContent$2); this._newContent$2.style.top = '0px'; this._newContent$2.style.left = '0px'; this._newContent$2.style.height = this._height$2 + 'px'; this._newContent$2.style.overflow = 'visible'; this._newContent$2.style.clip = 'rect(auto auto auto auto)'; }, performSetup: function nStuff__updateWipeOrSlide$performSetup() { this._height$2 = this.get_domElement().offsetHeight; this._width$2 = this.get_domElement().offsetWidth; this._newContent$2.style.visibility = 'visible'; this._newContent$2.style.overflow = 'hidden'; switch (this._animation$2) { case nStuff.UpdateAnimationType.slideUp: this._newContent$2.style.top = this._height$2 + 'px'; this._newContent$2.style.height = '0px'; break; case nStuff.UpdateAnimationType.slideDown: this._newContent$2.style.height = this._height$2 + 'px'; this._newContent$2.style.clip = 'rect(auto auto 0px auto)'; break; case nStuff.UpdateAnimationType.wipeLeft: this._newContent$2.style.height = this._height$2 + 'px'; this._newContent$2.style.clip = String.format('rect(auto auto auto {0}px)', this._width$2); break; case nStuff.UpdateAnimationType.wipeRight: this._newContent$2.style.height = this._height$2 + 'px'; this._newContent$2.style.clip = 'rect(auto 0px auto auto)'; break; } }, performTweening: function nStuff__updateWipeOrSlide$performTweening(frame) { switch (this._animation$2) { case nStuff.UpdateAnimationType.slideUp: var yOffset = Math.floor(this._height$2 * (1 - frame)); this._newContent$2.style.top = yOffset + 'px'; this._newContent$2.style.height = (this._height$2 - yOffset) + 'px'; break; case nStuff.UpdateAnimationType.slideDown: this._newContent$2.style.clip = String.format('rect(auto auto {0}px auto)', Math.floor(this._height$2 * frame)); break; case nStuff.UpdateAnimationType.wipeLeft: var xOffset = Math.floor(this._width$2 * (1 - frame)); break; case nStuff.UpdateAnimationType.wipeRight: this._newContent$2.style.clip = String.format('rect(auto {0}px auto auto)', Math.floor(this._width$2 * frame)); break; } }, playEffect: function nStuff__updateWipeOrSlide$playEffect(animation, oldContent, newContent) { this._animation$2 = animation; this._oldContent$2 = oldContent; this._newContent$2 = newContent; this.play(); } } //////////////////////////////////////////////////////////////////////////////// // nStuff._updateCrossFade nStuff._updateCrossFade = function nStuff__updateCrossFade(domElement, duration) { nStuff._updateCrossFade.initializeBase(this, [ domElement, duration ]); this.set_easingFunction(Function.createDelegate(null, ScriptFX.UI.TimedAnimation.easeInOut)); } nStuff._updateCrossFade.prototype = { _oldContent$2: null, _newContent$2: null, performCleanup: function nStuff__updateCrossFade$performCleanup() { this._oldContent$2.parentNode.removeChild(this._oldContent$2); }, performSetup: function nStuff__updateCrossFade$performSetup() { this._setOpacity$2(this._newContent$2, 0); this._newContent$2.style.visibility = 'visible'; this._newContent$2.style.filter = ''; }, performTweening: function nStuff__updateCrossFade$performTweening(frame) { this._setOpacity$2(this._newContent$2, frame); this._setOpacity$2(this._oldContent$2, 1 - frame); }, playEffect: function nStuff__updateCrossFade$playEffect(oldContent, newContent) { this._oldContent$2 = oldContent; this._newContent$2 = newContent; this.play(); }, _setOpacity$2: function nStuff__updateCrossFade$_setOpacity$2(element, opacity) { if (window.navigator.userAgent.indexOf('MSIE') >= 0) { element.style.filter = 'alpha(opacity=' + (opacity * 100) + ')'; } else { element.style.opacity = opacity.toString(); } } } //////////////////////////////////////////////////////////////////////////////// // nStuff._updateHighlight nStuff._updateHighlight = function nStuff__updateHighlight(domElement, duration) { nStuff._updateHighlight.initializeBase(this, [ domElement, duration ]); } nStuff._updateHighlight.prototype = { performCleanup: function nStuff__updateHighlight$performCleanup() { this.get_domElement().parentNode.removeChild(this.get_domElement()); }, performSetup: function nStuff__updateHighlight$performSetup() { this._setOpacity$2(0); this.get_domElement().style.display = ''; }, performTweening: function nStuff__updateHighlight$performTweening(frame) { this._setOpacity$2(Math.sin(frame * Math.PI) * 0.75); }, _setOpacity$2: function nStuff__updateHighlight$_setOpacity$2(opacity) { if (window.navigator.userAgent.indexOf('MSIE') >= 0) { this.get_domElement().style.filter = 'alpha(opacity=' + (opacity * 100) + ')'; } else { this.get_domElement().style.opacity = opacity.toString(); } } } //////////////////////////////////////////////////////////////////////////////// // nStuff.UpdateHistory nStuff.UpdateHistory = function nStuff_UpdateHistory() { nStuff.UpdateHistory.initializeBase(this); } nStuff.UpdateHistory.prototype = { _timerCookie$1: 0, _timerHandler$1: null, _iframeLoadHandler$1: null, _appLoadHandler$1: null, _endRequestHandler$1: null, _ignoreIFrame$1: false, _ignoreTimer$1: false, _historyFrame$1: null, _emptyPageURL$1: null, _dataID$1: null, _postbackID$1: null, _currentEntry$1: null, get_options: function nStuff_UpdateHistory$get_options() { return null; }, set_options: function nStuff_UpdateHistory$set_options(value) { this._currentEntry$1 = (value.initialEntry) ? value.initialEntry : ''; this._dataID$1 = value.dataID; this._postbackID$1 = value.postbackID; return value; }, _addEntry$1: function nStuff_UpdateHistory$_addEntry$1(entry) { this._ignoreTimer$1 = true; if (this._historyFrame$1) { this._ignoreIFrame$1 = true; this._historyFrame$1.src = this._emptyPageURL$1 + entry; } else { this._setEntry$1(entry); } }, dispose: function nStuff_UpdateHistory$dispose() { if (this._historyFrame$1) { this._historyFrame$1.detachEvent('onload', this._iframeLoadHandler$1); this._historyFrame$1 = null; } if (this._timerCookie$1) { window.clearTimeout(this._timerCookie$1); this._timerCookie$1 = 0; } if (this._endRequestHandler$1) { Sys.WebForms.PageRequestManager.getInstance().remove_endRequest(this._endRequestHandler$1); this._endRequestHandler$1 = null; } nStuff.UpdateHistory.callBaseMethod(this, 'dispose'); }, _getEntry$1: function nStuff_UpdateHistory$_getEntry$1() { var entry = window.location.hash; if ((entry.length >= 1) && (entry.charAt(0) === '#')) { entry = entry.substr(1); } return entry; }, initialize: function nStuff_UpdateHistory$initialize() { nStuff.UpdateHistory.callBaseMethod(this, 'initialize'); this._appLoadHandler$1 = Function.createDelegate(this, this._onAppLoad$1); Sys.Application.add_load(this._appLoadHandler$1); }, _navigate$1: function nStuff_UpdateHistory$_navigate$1(entry) { __doPostBack(this._postbackID$1, entry); }, _onAppLoad$1: function nStuff_UpdateHistory$_onAppLoad$1(sender, e) { Sys.Application.remove_load(this._appLoadHandler$1); this._appLoadHandler$1 = null; this._endRequestHandler$1 = Function.createDelegate(this, this._onPageRequestManagerEndRequest$1); Sys.WebForms.PageRequestManager.getInstance().add_endRequest(this._endRequestHandler$1); if (window.navigator.userAgent.indexOf('MSIE') >= 0) { this._historyFrame$1 = $get('__historyFrame'); this._emptyPageURL$1 = this._historyFrame$1.src + '?'; this._iframeLoadHandler$1 = Function.createDelegate(this, this._onIFrameLoad$1); this._historyFrame$1.attachEvent('onload', this._iframeLoadHandler$1); } this._timerHandler$1 = Function.createDelegate(this, this._onTick$1); this._timerCookie$1 = window.setTimeout(this._timerHandler$1, 100); var loadedEntry = this._getEntry$1(); if (loadedEntry !== this._currentEntry$1) { this._currentEntry$1 = loadedEntry; this._navigate$1(loadedEntry); } }, _onIFrameLoad$1: function nStuff_UpdateHistory$_onIFrameLoad$1() { var entry = this._historyFrame$1.contentWindow.location.search; if ((entry.length >= 1) && (entry.charAt(0) === '?')) { entry = entry.substr(1); } this._setEntry$1(entry); if (this._ignoreIFrame$1) { this._ignoreIFrame$1 = false; return; } this._navigate$1(entry); }, _onPageRequestManagerEndRequest$1: function nStuff_UpdateHistory$_onPageRequestManagerEndRequest$1(sender, e) { var entry = e.get_dataItems()[this._dataID$1]; if (entry) { this._addEntry$1(entry); } }, _onTick$1: function nStuff_UpdateHistory$_onTick$1() { this._timerCookie$1 = 0; var entry = this._getEntry$1(); if (entry !== this._currentEntry$1) { if (!this._ignoreTimer$1) { this._currentEntry$1 = entry; this._navigate$1(entry); } } else { this._ignoreTimer$1 = false; } this._timerCookie$1 = window.setTimeout(this._timerHandler$1, 100); }, _setEntry$1: function nStuff_UpdateHistory$_setEntry$1(entry) { this._currentEntry$1 = entry; window.location.hash = entry; } } Type.registerNamespace('ScriptFX.UI'); //////////////////////////////////////////////////////////////////////////////// // ScriptFX.UI.AnimationStopState ScriptFX.UI.AnimationStopState = function() { }; ScriptFX.UI.AnimationStopState.prototype = { complete: 0, abort: 1, revert: 2 } ScriptFX.UI.AnimationStopState.registerEnum('ScriptFX.UI.AnimationStopState', false); //////////////////////////////////////////////////////////////////////////////// // ScriptFX.UI.Animation ScriptFX.UI.Animation = function ScriptFX_UI_Animation(domElement) { if (!domElement) { domElement = document.documentElement; } this._domElement = domElement; Sys.Application.registerDisposableObject(this); } ScriptFX.UI.Animation.prototype = { _domElement: null, _completed: false, _isPlaying: false, get_completed: function ScriptFX_UI_Animation$get_completed() { return this._completed; }, get_domElement: function ScriptFX_UI_Animation$get_domElement() { return this._domElement; }, get_isPlaying: function ScriptFX_UI_Animation$get_isPlaying() { return this._isPlaying; }, dispose: function ScriptFX_UI_Animation$dispose() { if (this._isPlaying) { this.stop(ScriptFX.UI.AnimationStopState.abort); } if (this._domElement) { this._domElement = null; Sys.Application.unregisterDisposableObject(this); } }, _onPlay: function ScriptFX_UI_Animation$_onPlay(reversed) { this.performSetup(); this._isPlaying = true; this.playCore(); }, _onStop: function ScriptFX_UI_Animation$_onStop(completed, stopState) { this.stopCore(completed, stopState); this._completed = completed; this._isPlaying = false; this.performCleanup(); }, _onProgress: function ScriptFX_UI_Animation$_onProgress(timeStamp) { return this.progressCore(timeStamp); }, performCleanup: function ScriptFX_UI_Animation$performCleanup() { }, performRepetition: function ScriptFX_UI_Animation$performRepetition(reversed) { }, performSetup: function ScriptFX_UI_Animation$performSetup() { }, play: function ScriptFX_UI_Animation$play() { Sys.Debug.assert(!this.get_isPlaying()); this._completed = false; ScriptFX.UI.AnimationManager._play(this, this._domElement); }, stop: function ScriptFX_UI_Animation$stop(stopState) { Sys.Debug.assert(this.get_isPlaying()); ScriptFX.UI.AnimationManager._stop(this, stopState); } } //////////////////////////////////////////////////////////////////////////////// // ScriptFX.UI.AnimationManager ScriptFX.UI.AnimationManager = function ScriptFX_UI_AnimationManager() { } ScriptFX.UI.AnimationManager.get_FPS = function ScriptFX_UI_AnimationManager$get_FPS() { return ScriptFX.UI.AnimationManager._fps; } ScriptFX.UI.AnimationManager.set_FPS = function ScriptFX_UI_AnimationManager$set_FPS(value) { Sys.Debug.assert((value > 0) && (value <= 100)); ScriptFX.UI.AnimationManager._fps = value; return value; } ScriptFX.UI.AnimationManager._onTick = function ScriptFX_UI_AnimationManager$_onTick() { ScriptFX.UI.AnimationManager._timerCookie = 0; if (!ScriptFX.UI.AnimationManager._activeAnimations.length) { return; } var timeStamp = (new Date()).getTime(); var currentAnimations = ScriptFX.UI.AnimationManager._activeAnimations; var newAnimations = []; ScriptFX.UI.AnimationManager._activeAnimations = null; for (var i = 0; i < currentAnimations.length; i++) { var animation = currentAnimations[i]; var completed = animation._onProgress(timeStamp); if (completed) { animation._onStop(true, ScriptFX.UI.AnimationStopState.complete); } else { Array.add(newAnimations, animation); } } if (newAnimations.length) { ScriptFX.UI.AnimationManager._activeAnimations = newAnimations; if (!ScriptFX.UI.AnimationManager._timerCookie) { ScriptFX.UI.AnimationManager._timerCookie = window.setTimeout(Function.createDelegate(null, ScriptFX.UI.AnimationManager._onTick), 1000 / ScriptFX.UI.AnimationManager._fps); } } } ScriptFX.UI.AnimationManager._play = function ScriptFX_UI_AnimationManager$_play(animation, domElement) { if (!ScriptFX.UI.AnimationManager._activeAnimations) { ScriptFX.UI.AnimationManager._activeAnimations = []; } Array.add(ScriptFX.UI.AnimationManager._activeAnimations, animation); animation._onPlay(false); if (!ScriptFX.UI.AnimationManager._timerCookie) { ScriptFX.UI.AnimationManager._timerCookie = window.setTimeout(Function.createDelegate(null, ScriptFX.UI.AnimationManager._onTick), 1000 / ScriptFX.UI.AnimationManager._fps); } } ScriptFX.UI.AnimationManager._stop = function ScriptFX_UI_AnimationManager$_stop(animation, stopState) { Sys.Debug.assert(ScriptFX.UI.AnimationManager._activeAnimations); animation._onStop(false, stopState); Array.remove(ScriptFX.UI.AnimationManager._activeAnimations, animation); } //////////////////////////////////////////////////////////////////////////////// // ScriptFX.UI.TimedAnimation ScriptFX.UI.TimedAnimation = function ScriptFX_UI_TimedAnimation(domElement, duration) { ScriptFX.UI.TimedAnimation.initializeBase(this, [ domElement ]); Sys.Debug.assert(duration > 0); this._duration$1 = duration; } ScriptFX.UI.TimedAnimation.easeIn = function ScriptFX_UI_TimedAnimation$easeIn(t) { return t * t; } ScriptFX.UI.TimedAnimation.easeInOut = function ScriptFX_UI_TimedAnimation$easeInOut(t) { t = t * 2; if (t < 1) { return t * t / 2; } return -((--t) * (t - 2) - 1) / 2; } ScriptFX.UI.TimedAnimation.easeOut = function ScriptFX_UI_TimedAnimation$easeOut(t) { return -t * (t - 2); } ScriptFX.UI.TimedAnimation.prototype = { _duration$1: 0, _easingFunction$1: null, _startTimeStamp$1: 0, get_duration: function ScriptFX_UI_TimedAnimation$get_duration() { return this._duration$1; }, set_duration: function ScriptFX_UI_TimedAnimation$set_duration(value) { Sys.Debug.assert(!this.get_isPlaying()); Sys.Debug.assert(this._duration$1 >= 0); this._duration$1 = value; return value; }, get_easingFunction: function ScriptFX_UI_TimedAnimation$get_easingFunction() { return this._easingFunction$1; }, set_easingFunction: function ScriptFX_UI_TimedAnimation$set_easingFunction(value) { Sys.Debug.assert(!this.get_isPlaying()); this._easingFunction$1 = value; return value; }, playCore: function ScriptFX_UI_TimedAnimation$playCore() { this._startTimeStamp$1 = (new Date()).getTime(); this.progressCore(this._startTimeStamp$1); }, progressCore: function ScriptFX_UI_TimedAnimation$progressCore(timeStamp) { var frame = 0; var completed = false; frame = (timeStamp - this._startTimeStamp$1) / this._duration$1; completed = (frame >= 1); frame = Math.min(1, frame); if ((!completed) && (this._easingFunction$1)) { frame = this._easingFunction$1(frame); } this.performTweening(frame); return completed; }, stopCore: function ScriptFX_UI_TimedAnimation$stopCore(completed, stopState) { if (!completed) { if (stopState === ScriptFX.UI.AnimationStopState.complete) { this.performTweening(1); } else if (stopState === ScriptFX.UI.AnimationStopState.revert) { this.performTweening(0); } } } } nStuff.AnimatedUpdatePanel.registerClass('nStuff.AnimatedUpdatePanel', Sys.UI.Control); ScriptFX.UI.Animation.registerClass('ScriptFX.UI.Animation', null, Sys.IDisposable); ScriptFX.UI.TimedAnimation.registerClass('ScriptFX.UI.TimedAnimation', ScriptFX.UI.Animation); nStuff._updateScroll.registerClass('nStuff._updateScroll', ScriptFX.UI.TimedAnimation); nStuff.UpdateAction.registerClass('nStuff.UpdateAction', Sys.Component); nStuff._updateWipeOrSlide.registerClass('nStuff._updateWipeOrSlide', ScriptFX.UI.TimedAnimation); nStuff._updateCrossFade.registerClass('nStuff._updateCrossFade', ScriptFX.UI.TimedAnimation); nStuff._updateHighlight.registerClass('nStuff._updateHighlight', ScriptFX.UI.TimedAnimation); nStuff.UpdateHistory.registerClass('nStuff.UpdateHistory', Sys.Component); ScriptFX.UI.AnimationManager.registerClass('ScriptFX.UI.AnimationManager'); ScriptFX.UI.AnimationManager._fps = 100; ScriptFX.UI.AnimationManager._activeAnimations = null; ScriptFX.UI.AnimationManager._timerCookie = 0; // ---- Do not remove this footer ---- // Generated using Script# v0.3.0.0 (http://projects.nikhilk.net) // ----------------------------------- if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();