From 7c6eb8e937dec1c354a671702b0c3a76faa57f3e Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Fri, 16 Aug 2013 15:49:09 +0000 Subject: [PATCH] --- js/libs/fluidbook/fluidbook.background.js | 3 - js/libs/fluidbook/fluidbook.help.js | 9 +- js/libs/fluidbook/fluidbook.video.js | 2 +- js/libs/gsap/TimelineLite.js | 17 +- js/libs/gsap/TimelineMax.js | 30 +- js/libs/gsap/TweenLite.js | 62 ++- js/libs/gsap/TweenMax.js | 124 +++-- js/libs/gsap/plugins/CSSPlugin.js | 22 +- js/libs/jquery/jquery.migrate.js | 521 ---------------------- 9 files changed, 171 insertions(+), 619 deletions(-) delete mode 100644 js/libs/jquery/jquery.migrate.js diff --git a/js/libs/fluidbook/fluidbook.background.js b/js/libs/fluidbook/fluidbook.background.js index c640c006..9a313e4a 100644 --- a/js/libs/fluidbook/fluidbook.background.js +++ b/js/libs/fluidbook/fluidbook.background.js @@ -8,9 +8,6 @@ FluidbookBackground.prototype = { init: function() { $("#main").append('
'); - fb([Fluidbook.REPEAT,Fluidbook.STRETCH]); - - if (this.fluidbook.datas.links.background != undefined && this.fluidbook.datas.repeat != Fluidbook.REPEAT && this.fluidbook.datas.repeat != Fluidbook.STRETCH diff --git a/js/libs/fluidbook/fluidbook.help.js b/js/libs/fluidbook/fluidbook.help.js index f7f852bf..59cd72a4 100644 --- a/js/libs/fluidbook/fluidbook.help.js +++ b/js/libs/fluidbook/fluidbook.help.js @@ -167,7 +167,6 @@ FluidbookHelp.prototype = { } }, resize: function(ww, hh, interfaceScale, navScale) { - this.hide(); var menuHeightScaled = (this.fluidbook.datas.menuHeight) * navScale this.view.css({ width: ww, @@ -230,12 +229,10 @@ FluidbookHelp.prototype = { clearTimeout(this.autoTimeout); }, displayAtStartup: function() { - var $this = this; if (this.fluidbook.datas.helpStartup) { - - $this.show(parseInt($this.fluidbook.datas.helpStartupTime)); - if ($this.fluidbook.pad.enabled) { - $this.fluidbook.pad.displayInterface(); + this.show(parseInt(this.fluidbook.datas.helpStartupTime)); + if (this.fluidbook.pad.enabled) { + this.fluidbook.pad.displayInterface(); } } } diff --git a/js/libs/fluidbook/fluidbook.video.js b/js/libs/fluidbook/fluidbook.video.js index b89b4d67..83ac5a75 100644 --- a/js/libs/fluidbook/fluidbook.video.js +++ b/js/libs/fluidbook/fluidbook.video.js @@ -158,6 +158,6 @@ FluidbookVideo.prototype = { }); }, logCacheEvent: function(e) { - fb('video :' + e.type); + } }; \ No newline at end of file diff --git a/js/libs/gsap/TimelineLite.js b/js/libs/gsap/TimelineLite.js index b56cf5f2..5dfe8231 100644 --- a/js/libs/gsap/TimelineLite.js +++ b/js/libs/gsap/TimelineLite.js @@ -1,6 +1,6 @@ /*! - * VERSION: beta 1.10.1 - * DATE: 2013-07-10 + * VERSION: beta 1.10.2 + * DATE: 2013-08-05 * UPDATES AND DOCS AT: http://www.greensock.com * * @license Copyright (c) 2008-2013, GreenSock. All rights reserved. @@ -52,7 +52,7 @@ _slice = _blankArray.slice, p = TimelineLite.prototype = new SimpleTimeline(); - TimelineLite.version = "1.10.1"; + TimelineLite.version = "1.10.2"; p.constructor = TimelineLite; p.kill()._gc = false; @@ -332,11 +332,14 @@ if (this._duration === 0) if (this._rawPrevTime >= 0 && this._first) { //zero-duration timelines are tricky because we must discern the momentum/direction of time in order to determine whether the starting values should be rendered or the ending values. If the "playhead" of its timeline goes past the zero-duration tween in the forward direction or lands directly on it, the end values should be rendered, but if the timeline's "playhead" moves past it in the backward direction (from a postitive time to a negative time), the starting values must be rendered. internalForce = true; } - } else if (!this._initted) { - internalForce = true; + this._rawPrevTime = time; + } else { + this._rawPrevTime = time; + time = 0; //to avoid occasional floating point rounding errors (could cause problems especially with zero-duration tweens at the very beginning of the timeline) + if (!this._initted) { + internalForce = true; + } } - this._rawPrevTime = time; - time = 0; //to avoid occasional floating point rounding errors (could cause problems especially with zero-duration tweens at the very beginning of the timeline) } else { this._totalTime = this._time = this._rawPrevTime = time; diff --git a/js/libs/gsap/TimelineMax.js b/js/libs/gsap/TimelineMax.js index e42d34a9..1144c984 100644 --- a/js/libs/gsap/TimelineMax.js +++ b/js/libs/gsap/TimelineMax.js @@ -1,6 +1,6 @@ /*! - * VERSION: beta 1.10.1 - * DATE: 2013-07-10 + * VERSION: beta 1.10.2 + * DATE: 2013-08-05 * UPDATES AND DOCS AT: http://www.greensock.com * * @license Copyright (c) 2008-2013, GreenSock. All rights reserved. @@ -39,7 +39,7 @@ p.constructor = TimelineMax; p.kill()._gc = false; - TimelineMax.version = "1.10.1"; + TimelineMax.version = "1.10.2"; p.invalidate = function() { this._yoyo = (this.vars.yoyo === true); @@ -151,11 +151,14 @@ if (dur === 0) if (this._rawPrevTime >= 0 && this._first) { //zero-duration timelines are tricky because we must discern the momentum/direction of time in order to determine whether the starting values should be rendered or the ending values. If the "playhead" of its timeline goes past the zero-duration tween in the forward direction or lands directly on it, the end values should be rendered, but if the timeline's "playhead" moves past it in the backward direction (from a postitive time to a negative time), the starting values must be rendered. internalForce = true; } - } else if (!this._initted) { - internalForce = true; + this._rawPrevTime = time; + } else { + this._rawPrevTime = time; + time = 0; //to avoid occasional floating point rounding errors (could cause problems especially with zero-duration tweens at the very beginning of the timeline) + if (!this._initted) { + internalForce = true; + } } - this._rawPrevTime = time; - time = 0; //to avoid occasional floating point rounding errors (could cause problems especially with zero-duration tweens at the very beginning of the timeline) } else { this._time = this._rawPrevTime = time; @@ -492,7 +495,7 @@ _slice = _blankArray.slice, p = TimelineLite.prototype = new SimpleTimeline(); - TimelineLite.version = "1.10.1"; + TimelineLite.version = "1.10.2"; p.constructor = TimelineLite; p.kill()._gc = false; @@ -772,11 +775,14 @@ if (this._duration === 0) if (this._rawPrevTime >= 0 && this._first) { //zero-duration timelines are tricky because we must discern the momentum/direction of time in order to determine whether the starting values should be rendered or the ending values. If the "playhead" of its timeline goes past the zero-duration tween in the forward direction or lands directly on it, the end values should be rendered, but if the timeline's "playhead" moves past it in the backward direction (from a postitive time to a negative time), the starting values must be rendered. internalForce = true; } - } else if (!this._initted) { - internalForce = true; + this._rawPrevTime = time; + } else { + this._rawPrevTime = time; + time = 0; //to avoid occasional floating point rounding errors (could cause problems especially with zero-duration tweens at the very beginning of the timeline) + if (!this._initted) { + internalForce = true; + } } - this._rawPrevTime = time; - time = 0; //to avoid occasional floating point rounding errors (could cause problems especially with zero-duration tweens at the very beginning of the timeline) } else { this._totalTime = this._time = this._rawPrevTime = time; diff --git a/js/libs/gsap/TweenLite.js b/js/libs/gsap/TweenLite.js index 6d902410..3fd6e347 100644 --- a/js/libs/gsap/TweenLite.js +++ b/js/libs/gsap/TweenLite.js @@ -1,6 +1,6 @@ /*! - * VERSION: beta 1.10.1 - * DATE: 2013-07-10 + * VERSION: beta 1.10.2 + * DATE: 2013-08-05 * UPDATES AND DOCS AT: http://www.greensock.com * * @license Copyright (c) 2008-2013, GreenSock. All rights reserved. @@ -253,7 +253,8 @@ */ var _reqAnimFrame = window.requestAnimationFrame, _cancelAnimFrame = window.cancelAnimationFrame, - _getTime = Date.now || function() {return new Date().getTime();}; + _getTime = Date.now || function() {return new Date().getTime();}, + _lastUpdate = _getTime(); //now try to determine the requestAnimationFrame and cancelAnimationFrame functions and if none are found, we'll use a setTimeout()/clearTimeout() polyfill. a = ["ms","moz","webkit","o"]; @@ -269,17 +270,21 @@ _useRAF = (useRAF !== false && _reqAnimFrame), _fps, _req, _id, _gap, _nextTime, _tick = function(manual) { - _self.time = (_getTime() - _startTime) / 1000; - var id = _id, - overlap = _self.time - _nextTime; + _lastUpdate = _getTime(); + _self.time = (_lastUpdate - _startTime) / 1000; + var overlap = _self.time - _nextTime, + dispatch; if (!_fps || overlap > 0 || manual === true) { _self.frame++; _nextTime += overlap + (overlap >= _gap ? 0.004 : _gap - overlap); - _self.dispatchEvent("tick"); + dispatch = true; } - if (manual !== true && id === _id) { //make sure the ids match in case the "tick" dispatch triggered something that caused the ticker to shut down or change _useRAF or something like that. + if (manual !== true) { //make sure the request is made before we dispatch the "tick" event so that timing is maintained. Otherwise, if processing the "tick" requires a bunch of time (like 15ms) and we're using a setTimeout() that's based on 16.7ms, it'd technically take 31.7ms between frames otherwise. _id = _req(_tick); } + if (dispatch) { + _self.dispatchEvent("tick"); + } }; EventDispatcher.call(_self); @@ -353,18 +358,18 @@ * ---------------------------------------------------------------- */ var Animation = _class("core.Animation", function(duration, vars) { - this.vars = vars || {}; + this.vars = vars = vars || {}; this._duration = this._totalDuration = duration || 0; - this._delay = Number(this.vars.delay) || 0; + this._delay = Number(vars.delay) || 0; this._timeScale = 1; - this._active = (this.vars.immediateRender === true); - this.data = this.vars.data; - this._reversed = (this.vars.reversed === true); + this._active = (vars.immediateRender === true); + this.data = vars.data; + this._reversed = (vars.reversed === true); if (!_rootTimeline) { return; } - if (!_tickerActive) { + if (!_tickerActive) { //some browsers (like iOS 6 Safari) shut down JavaScript execution when the tab is disabled and they [occasionally] neglect to start up requestAnimationFrame again when returning - this code ensures that the engine starts up again properly. _ticker.wake(); } @@ -383,6 +388,17 @@ p._rawPrevTime = -1; p._next = p._last = p._onUpdate = p._timeline = p.timeline = null; p._paused = false; + + + //some browsers (like iOS) occasionally drop the requestAnimationFrame event when the user switches to a different tab and then comes back again, so we use a 2-second setTimeout() to sense if/when that condition occurs and then wake() the ticker. + var _checkTimeout = function() { + if (_getTime() - _lastUpdate > 2000) { + _ticker.wake(); + } + setTimeout(_checkTimeout, 2000); + }; + _checkTimeout(); + p.play = function(from, suppressEvents) { if (arguments.length) { @@ -420,8 +436,8 @@ return this.reversed(true).paused(false); }; - p.render = function() { - + p.render = function(time, suppressEvents, force) { + //stub - we override this method in subclasses. }; p.invalidate = function() { @@ -758,6 +774,7 @@ */ var TweenLite = _class("TweenLite", function(target, duration, vars) { Animation.call(this, duration, vars); + this.render = TweenLite.prototype.render; //speed optimization (avoid prototype lookup on this "hot" method) if (target == null) { throw "Cannot tween a null target."; @@ -833,7 +850,7 @@ p._firstPT = p._targets = p._overwrittenProps = p._startAt = null; p._notifyPluginsOfEnabled = false; - TweenLite.version = "1.10.1"; + TweenLite.version = "1.10.2"; TweenLite.defaultEase = p._ease = new Ease(null, null, 1, 1); TweenLite.defaultOverwrite = "auto"; TweenLite.ticker = _ticker; @@ -978,15 +995,20 @@ var v = this.vars, op = this._overwrittenProps, dur = this._duration, + immediate = v.immediateRender, ease = v.ease, i, initPlugins, pt, p; if (v.startAt) { + if (this._startAt) { + this._startAt.render(-1, true); //if we've run a startAt previously (when the tween instantiated), we should revert it so that the values re-instantiate correctly particularly for relative tweens. Without this, a TweenLite.fromTo(obj, 1, {x:"+=100"}, {x:"-=100"}), for example, would actually jump to +=200 because the startAt would run twice, doubling the relative change. + } v.startAt.overwrite = 0; v.startAt.immediateRender = true; this._startAt = TweenLite.to(this.target, 0, v.startAt); - if (v.immediateRender) { - this._startAt = null; //tweens that render immediately (like most from() and fromTo() tweens) shouldn't revert when their parent timeline's playhead goes backward past the startTime because the initial render could have happened anytime and it shouldn't be directly correlated to this tween's startTime. Imagine setting up a complex animation where the beginning states of various objects are rendered immediately but the tween doesn't happen for quite some time - if we revert to the starting values as soon as the playhead goes backward past the tween's startTime, it will throw things off visually. Reversion should only happen in TimelineLite/Max instances where immediateRender was false (which is the default in the convenience methods like from()). - if (this._time === 0 && dur !== 0) { + if (immediate) { + if (this._time > 0) { + this._startAt = null; //tweens that render immediately (like most from() and fromTo() tweens) shouldn't revert when their parent timeline's playhead goes backward past the startTime because the initial render could have happened anytime and it shouldn't be directly correlated to this tween's startTime. Imagine setting up a complex animation where the beginning states of various objects are rendered immediately but the tween doesn't happen for quite some time - if we revert to the starting values as soon as the playhead goes backward past the tween's startTime, it will throw things off visually. Reversion should only happen in TimelineLite/Max instances where immediateRender was false (which is the default in the convenience methods like from()). + } else if (dur !== 0) { return; //we skip initialization here so that overwriting doesn't occur until the tween actually begins. Otherwise, if you create several immediateRender:true tweens of the same target/properties to drop into a TimelineLite or TimelineMax, the last one created would overwrite the first ones because they didn't get placed into the timeline yet before the first render occurs and kicks in overwriting. } } diff --git a/js/libs/gsap/TweenMax.js b/js/libs/gsap/TweenMax.js index 68f55768..a856b9ff 100644 --- a/js/libs/gsap/TweenMax.js +++ b/js/libs/gsap/TweenMax.js @@ -1,6 +1,6 @@ /*! - * VERSION: beta 1.10.1 - * DATE: 2013-07-10 + * VERSION: beta 1.10.2 + * DATE: 2013-08-05 * UPDATES AND DOCS AT: http://www.greensock.com * * Includes all of the following: TweenLite, TweenMax, TimelineLite, TimelineMax, EasePack, CSSPlugin, RoundPropsPlugin, BezierPlugin, AttrPlugin, DirectionalRotationPlugin @@ -26,6 +26,7 @@ this._repeat = this.vars.repeat || 0; this._repeatDelay = this.vars.repeatDelay || 0; this._dirty = true; //ensures that if there is any repeat, the totalDuration will get recalculated to accurately report it. + this.render = TweenMax.prototype.render; //speed optimization (avoid prototype lookup on this "hot" method) }, _isSelector = function(v) { return (v.jquery || (v.length && v !== window && v[0] && (v[0] === window || (v[0].nodeType && v[0].style && !v.nodeType)))); //note: we cannot check "nodeType" on window from inside an iframe (some browsers throw a security error) @@ -33,7 +34,7 @@ p = TweenMax.prototype = TweenLite.to({}, 0.1, {}), _blankArray = []; - TweenMax.version = "1.10.1"; + TweenMax.version = "1.10.2"; p.constructor = TweenMax; p.kill()._gc = false; TweenMax.killTweensOf = TweenMax.killDelayedCallsTo = TweenLite.killTweensOf; @@ -461,6 +462,21 @@ TweenMax.resumeAll = function(tweens, delayedCalls, timelines) { _changePause(false, tweens, delayedCalls, timelines); }; + + TweenMax.globalTimeScale = function(value) { + var tl = Animation._rootTimeline, + t = TweenLite.ticker.time; + if (!arguments.length) { + return tl._timeScale; + } + value = value || 0.000001; //can't allow zero because it'll throw the math off + tl._startTime = t - ((t - tl._startTime) * tl._timeScale / value); + tl = Animation._rootFramesTimeline; + t = TweenLite.ticker.frame; + tl._startTime = t - ((t - tl._startTime) * tl._timeScale / value); + tl._timeScale = Animation._rootTimeline._timeScale = value; + return value; + }; //---- GETTERS / SETTERS ---------------------------------------------------------------------------------------------------------- @@ -589,7 +605,7 @@ _slice = _blankArray.slice, p = TimelineLite.prototype = new SimpleTimeline(); - TimelineLite.version = "1.10.1"; + TimelineLite.version = "1.10.2"; p.constructor = TimelineLite; p.kill()._gc = false; @@ -869,11 +885,14 @@ if (this._duration === 0) if (this._rawPrevTime >= 0 && this._first) { //zero-duration timelines are tricky because we must discern the momentum/direction of time in order to determine whether the starting values should be rendered or the ending values. If the "playhead" of its timeline goes past the zero-duration tween in the forward direction or lands directly on it, the end values should be rendered, but if the timeline's "playhead" moves past it in the backward direction (from a postitive time to a negative time), the starting values must be rendered. internalForce = true; } - } else if (!this._initted) { - internalForce = true; + this._rawPrevTime = time; + } else { + this._rawPrevTime = time; + time = 0; //to avoid occasional floating point rounding errors (could cause problems especially with zero-duration tweens at the very beginning of the timeline) + if (!this._initted) { + internalForce = true; + } } - this._rawPrevTime = time; - time = 0; //to avoid occasional floating point rounding errors (could cause problems especially with zero-duration tweens at the very beginning of the timeline) } else { this._totalTime = this._time = this._rawPrevTime = time; @@ -1192,7 +1211,7 @@ p.constructor = TimelineMax; p.kill()._gc = false; - TimelineMax.version = "1.10.1"; + TimelineMax.version = "1.10.2"; p.invalidate = function() { this._yoyo = (this.vars.yoyo === true); @@ -1304,11 +1323,14 @@ if (dur === 0) if (this._rawPrevTime >= 0 && this._first) { //zero-duration timelines are tricky because we must discern the momentum/direction of time in order to determine whether the starting values should be rendered or the ending values. If the "playhead" of its timeline goes past the zero-duration tween in the forward direction or lands directly on it, the end values should be rendered, but if the timeline's "playhead" moves past it in the backward direction (from a postitive time to a negative time), the starting values must be rendered. internalForce = true; } - } else if (!this._initted) { - internalForce = true; + this._rawPrevTime = time; + } else { + this._rawPrevTime = time; + time = 0; //to avoid occasional floating point rounding errors (could cause problems especially with zero-duration tweens at the very beginning of the timeline) + if (!this._initted) { + internalForce = true; + } } - this._rawPrevTime = time; - time = 0; //to avoid occasional floating point rounding errors (could cause problems especially with zero-duration tweens at the very beginning of the timeline) } else { this._time = this._rawPrevTime = time; @@ -2198,6 +2220,7 @@ var CSSPlugin = function() { TweenPlugin.call(this, "css"); this._overwriteProps.length = 0; + this.setRatio = CSSPlugin.prototype.setRatio; //speed optimization (avoid prototype lookup on this "hot" method) }, _hasPriority, //turns true whenever a CSSPropTween instance is created that has a priority other than 0. This helps us discern whether or not we should spend the time organizing the linked list or not after a CSSPlugin's _onInitTween() method is called. _suffixMap, //we set this in _onInitTween() each time as a way to have a persistent variable we can use in other methods like _parse() without having to pass it around as a parameter and we keep _parse() decoupled from a particular CSSPlugin instance @@ -2207,7 +2230,7 @@ p = CSSPlugin.prototype = new TweenPlugin("css"); p.constructor = CSSPlugin; - CSSPlugin.version = "1.10.1"; + CSSPlugin.version = "1.10.2"; CSSPlugin.API = 2; CSSPlugin.defaultTransformPerspective = 0; p = "px"; //we'll reuse the "p" variable to keep file size down @@ -3871,8 +3894,8 @@ pt.setRatio = _setIEOpacityRatio; } if (isAutoAlpha) { //we have to create the "visibility" PropTween after the opacity one in the linked list so that they run in the order that works properly in IE8 and earlier - pt = new CSSPropTween(style, "visibility", 0, 0, pt, -1, null, false, 0, ((b !== 0) ? "visible" : "hidden"), ((e === 0) ? "hidden" : "visible")); - pt.xs0 = "visible"; + pt = new CSSPropTween(style, "visibility", 0, 0, pt, -1, null, false, 0, ((b !== 0) ? "inherit" : "hidden"), ((e === 0) ? "hidden" : "inherit")); + pt.xs0 = "inherit"; cssp._overwriteProps.push(pt.n); } return pt; @@ -4286,15 +4309,16 @@ if (pt._next) { pt._next._prev = pt._prev; } - if (prev) { - prev._next = pt; - } else if (!remove && this._firstPT === null) { - this._firstPT = pt; - } if (pt._prev) { pt._prev._next = pt._next; } else if (this._firstPT === pt) { this._firstPT = pt._next; + remove = true; //just to prevent resetting this._firstPT 5 lines down in case pt._next is null. (optimized for speed) + } + if (prev) { + prev._next = pt; + } else if (!remove && this._firstPT === null) { + this._firstPT = pt; } pt._next = next; pt._prev = prev; @@ -5219,7 +5243,8 @@ */ var _reqAnimFrame = window.requestAnimationFrame, _cancelAnimFrame = window.cancelAnimationFrame, - _getTime = Date.now || function() {return new Date().getTime();}; + _getTime = Date.now || function() {return new Date().getTime();}, + _lastUpdate = _getTime(); //now try to determine the requestAnimationFrame and cancelAnimationFrame functions and if none are found, we'll use a setTimeout()/clearTimeout() polyfill. a = ["ms","moz","webkit","o"]; @@ -5235,17 +5260,21 @@ _useRAF = (useRAF !== false && _reqAnimFrame), _fps, _req, _id, _gap, _nextTime, _tick = function(manual) { - _self.time = (_getTime() - _startTime) / 1000; - var id = _id, - overlap = _self.time - _nextTime; + _lastUpdate = _getTime(); + _self.time = (_lastUpdate - _startTime) / 1000; + var overlap = _self.time - _nextTime, + dispatch; if (!_fps || overlap > 0 || manual === true) { _self.frame++; _nextTime += overlap + (overlap >= _gap ? 0.004 : _gap - overlap); - _self.dispatchEvent("tick"); + dispatch = true; } - if (manual !== true && id === _id) { //make sure the ids match in case the "tick" dispatch triggered something that caused the ticker to shut down or change _useRAF or something like that. + if (manual !== true) { //make sure the request is made before we dispatch the "tick" event so that timing is maintained. Otherwise, if processing the "tick" requires a bunch of time (like 15ms) and we're using a setTimeout() that's based on 16.7ms, it'd technically take 31.7ms between frames otherwise. _id = _req(_tick); } + if (dispatch) { + _self.dispatchEvent("tick"); + } }; EventDispatcher.call(_self); @@ -5319,18 +5348,18 @@ * ---------------------------------------------------------------- */ var Animation = _class("core.Animation", function(duration, vars) { - this.vars = vars || {}; + this.vars = vars = vars || {}; this._duration = this._totalDuration = duration || 0; - this._delay = Number(this.vars.delay) || 0; + this._delay = Number(vars.delay) || 0; this._timeScale = 1; - this._active = (this.vars.immediateRender === true); - this.data = this.vars.data; - this._reversed = (this.vars.reversed === true); + this._active = (vars.immediateRender === true); + this.data = vars.data; + this._reversed = (vars.reversed === true); if (!_rootTimeline) { return; } - if (!_tickerActive) { + if (!_tickerActive) { //some browsers (like iOS 6 Safari) shut down JavaScript execution when the tab is disabled and they [occasionally] neglect to start up requestAnimationFrame again when returning - this code ensures that the engine starts up again properly. _ticker.wake(); } @@ -5350,6 +5379,17 @@ p._next = p._last = p._onUpdate = p._timeline = p.timeline = null; p._paused = false; + + //some browsers (like iOS) occasionally drop the requestAnimationFrame event when the user switches to a different tab and then comes back again, so we use a 2-second setTimeout() to sense if/when that condition occurs and then wake() the ticker. + var _checkTimeout = function() { + if (_getTime() - _lastUpdate > 2000) { + _ticker.wake(); + } + setTimeout(_checkTimeout, 2000); + }; + _checkTimeout(); + + p.play = function(from, suppressEvents) { if (arguments.length) { this.seek(from, suppressEvents); @@ -5386,8 +5426,8 @@ return this.reversed(true).paused(false); }; - p.render = function() { - + p.render = function(time, suppressEvents, force) { + //stub - we override this method in subclasses. }; p.invalidate = function() { @@ -5724,6 +5764,7 @@ */ var TweenLite = _class("TweenLite", function(target, duration, vars) { Animation.call(this, duration, vars); + this.render = TweenLite.prototype.render; //speed optimization (avoid prototype lookup on this "hot" method) if (target == null) { throw "Cannot tween a null target."; @@ -5799,7 +5840,7 @@ p._firstPT = p._targets = p._overwrittenProps = p._startAt = null; p._notifyPluginsOfEnabled = false; - TweenLite.version = "1.10.1"; + TweenLite.version = "1.10.2"; TweenLite.defaultEase = p._ease = new Ease(null, null, 1, 1); TweenLite.defaultOverwrite = "auto"; TweenLite.ticker = _ticker; @@ -5944,15 +5985,20 @@ var v = this.vars, op = this._overwrittenProps, dur = this._duration, + immediate = v.immediateRender, ease = v.ease, i, initPlugins, pt, p; if (v.startAt) { + if (this._startAt) { + this._startAt.render(-1, true); //if we've run a startAt previously (when the tween instantiated), we should revert it so that the values re-instantiate correctly particularly for relative tweens. Without this, a TweenLite.fromTo(obj, 1, {x:"+=100"}, {x:"-=100"}), for example, would actually jump to +=200 because the startAt would run twice, doubling the relative change. + } v.startAt.overwrite = 0; v.startAt.immediateRender = true; this._startAt = TweenLite.to(this.target, 0, v.startAt); - if (v.immediateRender) { - this._startAt = null; //tweens that render immediately (like most from() and fromTo() tweens) shouldn't revert when their parent timeline's playhead goes backward past the startTime because the initial render could have happened anytime and it shouldn't be directly correlated to this tween's startTime. Imagine setting up a complex animation where the beginning states of various objects are rendered immediately but the tween doesn't happen for quite some time - if we revert to the starting values as soon as the playhead goes backward past the tween's startTime, it will throw things off visually. Reversion should only happen in TimelineLite/Max instances where immediateRender was false (which is the default in the convenience methods like from()). - if (this._time === 0 && dur !== 0) { + if (immediate) { + if (this._time > 0) { + this._startAt = null; //tweens that render immediately (like most from() and fromTo() tweens) shouldn't revert when their parent timeline's playhead goes backward past the startTime because the initial render could have happened anytime and it shouldn't be directly correlated to this tween's startTime. Imagine setting up a complex animation where the beginning states of various objects are rendered immediately but the tween doesn't happen for quite some time - if we revert to the starting values as soon as the playhead goes backward past the tween's startTime, it will throw things off visually. Reversion should only happen in TimelineLite/Max instances where immediateRender was false (which is the default in the convenience methods like from()). + } else if (dur !== 0) { return; //we skip initialization here so that overwriting doesn't occur until the tween actually begins. Otherwise, if you create several immediateRender:true tweens of the same target/properties to drop into a TimelineLite or TimelineMax, the last one created would overwrite the first ones because they didn't get placed into the timeline yet before the first render occurs and kicks in overwriting. } } diff --git a/js/libs/gsap/plugins/CSSPlugin.js b/js/libs/gsap/plugins/CSSPlugin.js index 83857b8c..6bd41f8b 100644 --- a/js/libs/gsap/plugins/CSSPlugin.js +++ b/js/libs/gsap/plugins/CSSPlugin.js @@ -1,6 +1,6 @@ /*! - * VERSION: beta 1.10.1 - * DATE: 2013-07-03 + * VERSION: beta 1.10.2 + * DATE: 2013-08-05 * UPDATES AND DOCS AT: http://www.greensock.com * * @license Copyright (c) 2008-2013, GreenSock. All rights reserved. @@ -19,6 +19,7 @@ var CSSPlugin = function() { TweenPlugin.call(this, "css"); this._overwriteProps.length = 0; + this.setRatio = CSSPlugin.prototype.setRatio; //speed optimization (avoid prototype lookup on this "hot" method) }, _hasPriority, //turns true whenever a CSSPropTween instance is created that has a priority other than 0. This helps us discern whether or not we should spend the time organizing the linked list or not after a CSSPlugin's _onInitTween() method is called. _suffixMap, //we set this in _onInitTween() each time as a way to have a persistent variable we can use in other methods like _parse() without having to pass it around as a parameter and we keep _parse() decoupled from a particular CSSPlugin instance @@ -28,7 +29,7 @@ p = CSSPlugin.prototype = new TweenPlugin("css"); p.constructor = CSSPlugin; - CSSPlugin.version = "1.10.1"; + CSSPlugin.version = "1.10.2"; CSSPlugin.API = 2; CSSPlugin.defaultTransformPerspective = 0; p = "px"; //we'll reuse the "p" variable to keep file size down @@ -1692,8 +1693,8 @@ pt.setRatio = _setIEOpacityRatio; } if (isAutoAlpha) { //we have to create the "visibility" PropTween after the opacity one in the linked list so that they run in the order that works properly in IE8 and earlier - pt = new CSSPropTween(style, "visibility", 0, 0, pt, -1, null, false, 0, ((b !== 0) ? "visible" : "hidden"), ((e === 0) ? "hidden" : "visible")); - pt.xs0 = "visible"; + pt = new CSSPropTween(style, "visibility", 0, 0, pt, -1, null, false, 0, ((b !== 0) ? "inherit" : "hidden"), ((e === 0) ? "hidden" : "inherit")); + pt.xs0 = "inherit"; cssp._overwriteProps.push(pt.n); } return pt; @@ -2107,15 +2108,16 @@ if (pt._next) { pt._next._prev = pt._prev; } - if (prev) { - prev._next = pt; - } else if (!remove && this._firstPT === null) { - this._firstPT = pt; - } if (pt._prev) { pt._prev._next = pt._next; } else if (this._firstPT === pt) { this._firstPT = pt._next; + remove = true; //just to prevent resetting this._firstPT 5 lines down in case pt._next is null. (optimized for speed) + } + if (prev) { + prev._next = pt; + } else if (!remove && this._firstPT === null) { + this._firstPT = pt; } pt._next = next; pt._prev = prev; diff --git a/js/libs/jquery/jquery.migrate.js b/js/libs/jquery/jquery.migrate.js deleted file mode 100644 index 25b6c813..00000000 --- a/js/libs/jquery/jquery.migrate.js +++ /dev/null @@ -1,521 +0,0 @@ -/*! - * jQuery Migrate - v1.2.1 - 2013-05-08 - * https://github.com/jquery/jquery-migrate - * Copyright 2005, 2013 jQuery Foundation, Inc. and other contributors; Licensed MIT - */ -(function( jQuery, window, undefined ) { -// See http://bugs.jquery.com/ticket/13335 -// "use strict"; - - -var warnedAbout = {}; - -// List of warnings already given; public read only -jQuery.migrateWarnings = []; - -// Set to true to prevent console output; migrateWarnings still maintained -// jQuery.migrateMute = false; - -// Show a message on the console so devs know we're active -if ( !jQuery.migrateMute && window.console && window.console.log ) { - window.console.log("JQMIGRATE: Logging is active"); -} - -// Set to false to disable traces that appear with warnings -if ( jQuery.migrateTrace === undefined ) { - jQuery.migrateTrace = true; -} - -// Forget any warnings we've already given; public -jQuery.migrateReset = function() { - warnedAbout = {}; - jQuery.migrateWarnings.length = 0; -}; - -function migrateWarn( msg) { - var console = window.console; - if ( !warnedAbout[ msg ] ) { - warnedAbout[ msg ] = true; - jQuery.migrateWarnings.push( msg ); - if ( console && console.warn && !jQuery.migrateMute ) { - console.warn( "JQMIGRATE: " + msg ); - if ( jQuery.migrateTrace && console.trace ) { - console.trace(); - } - } - } -} - -function migrateWarnProp( obj, prop, value, msg ) { - if ( Object.defineProperty ) { - // On ES5 browsers (non-oldIE), warn if the code tries to get prop; - // allow property to be overwritten in case some other plugin wants it - try { - Object.defineProperty( obj, prop, { - configurable: true, - enumerable: true, - get: function() { - migrateWarn( msg ); - return value; - }, - set: function( newValue ) { - migrateWarn( msg ); - value = newValue; - } - }); - return; - } catch( err ) { - // IE8 is a dope about Object.defineProperty, can't warn there - } - } - - // Non-ES5 (or broken) browser; just set the property - jQuery._definePropertyBroken = true; - obj[ prop ] = value; -} - -if ( document.compatMode === "BackCompat" ) { - // jQuery has never supported or tested Quirks Mode - migrateWarn( "jQuery is not compatible with Quirks Mode" ); -} - - -var attrFn = jQuery( "", { size: 1 } ).attr("size") && jQuery.attrFn, - oldAttr = jQuery.attr, - valueAttrGet = jQuery.attrHooks.value && jQuery.attrHooks.value.get || - function() { return null; }, - valueAttrSet = jQuery.attrHooks.value && jQuery.attrHooks.value.set || - function() { return undefined; }, - rnoType = /^(?:input|button)$/i, - rnoAttrNodeType = /^[238]$/, - rboolean = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i, - ruseDefault = /^(?:checked|selected)$/i; - -// jQuery.attrFn -migrateWarnProp( jQuery, "attrFn", attrFn || {}, "jQuery.attrFn is deprecated" ); - -jQuery.attr = function( elem, name, value, pass ) { - var lowerName = name.toLowerCase(), - nType = elem && elem.nodeType; - - if ( pass ) { - // Since pass is used internally, we only warn for new jQuery - // versions where there isn't a pass arg in the formal params - if ( oldAttr.length < 4 ) { - migrateWarn("jQuery.fn.attr( props, pass ) is deprecated"); - } - if ( elem && !rnoAttrNodeType.test( nType ) && - (attrFn ? name in attrFn : jQuery.isFunction(jQuery.fn[name])) ) { - return jQuery( elem )[ name ]( value ); - } - } - - // Warn if user tries to set `type`, since it breaks on IE 6/7/8; by checking - // for disconnected elements we don't warn on $( "