Skip to content

Commit

Permalink
YUI 2.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jcoglan committed Sep 9, 2008
1 parent 23226cb commit 381b098
Show file tree
Hide file tree
Showing 1,233 changed files with 178,486 additions and 44,229 deletions.
6 changes: 0 additions & 6 deletions README
@@ -1,11 +1,5 @@
YUI Library Release Notes

*** version 2.4.1 ***

This release fixes a IE memory leak when attaching listeners
to iframes/windows, as well as a few example updates. Of the
YUI components, only event has changed since 2.4.0.

*** version 2.4.0 ***

This release introduces five new components into YUI:
Expand Down
4 changes: 2 additions & 2 deletions build/animation/README
@@ -1,7 +1,7 @@
Animation Release Notes

*** version 2.4.1 ***
* No change
*** version 2.5.0 ***
* replace toString overrides with static NAME property

*** version 2.4.0 ***
* calling stop() on an non-animated Anim no longer fires onComplete
Expand Down
129 changes: 66 additions & 63 deletions build/animation/animation-debug.js
@@ -1,9 +1,13 @@
/*
Copyright (c) 2007, Yahoo! Inc. All rights reserved.
Copyright (c) 2008, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 2.4.1
version: 2.5.0
*/
(function() {

var Y = YAHOO.util;

/*
Copyright (c) 2006, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
Expand Down Expand Up @@ -37,23 +41,25 @@ http://developer.yahoo.net/yui/license.txt
* @param {Function} method (optional, defaults to YAHOO.util.Easing.easeNone) Computes the values that are applied to the attributes per frame (generally a YAHOO.util.Easing method)
*/

YAHOO.util.Anim = function(el, attributes, duration, method) {
var Anim = function(el, attributes, duration, method) {
if (!el) {
YAHOO.log('element required to create Anim instance', 'error', 'Anim');
}
this.init(el, attributes, duration, method);
};

YAHOO.util.Anim.prototype = {
Anim.NAME = 'Anim';

Anim.prototype = {
/**
* Provides a readable name for the Anim instance.
* @method toString
* @return {String}
*/
toString: function() {
var el = this.getEl();
var id = el.id || el.tagName || el;
return ("Anim " + id);
var el = this.getEl() || {};
var id = el.id || el.tagName;
return (this.constructor.NAME + ': ' + id);
},

patterns: { // cached for performance
Expand Down Expand Up @@ -87,7 +93,7 @@ YAHOO.util.Anim.prototype = {
val = (val > 0) ? val : 0;
}

YAHOO.util.Dom.setStyle(this.getEl(), attr, val + unit);
Y.Dom.setStyle(this.getEl(), attr, val + unit);
},

/**
Expand All @@ -98,7 +104,7 @@ YAHOO.util.Anim.prototype = {
*/
getAttribute: function(attr) {
var el = this.getEl();
var val = YAHOO.util.Dom.getStyle(el, attr);
var val = Y.Dom.getStyle(el, attr);

if (val !== 'auto' && !this.patterns.offsetUnit.test(val)) {
return parseFloat(val);
Expand All @@ -109,7 +115,7 @@ YAHOO.util.Anim.prototype = {
var box = !!( a[2] ); // width or height

// use offsets for width/height and abs pos top/left
if ( box || (YAHOO.util.Dom.getStyle(el, 'position') == 'absolute' && pos) ) {
if ( box || (Y.Dom.getStyle(el, 'position') == 'absolute' && pos) ) {
val = el['offset' + a[0].charAt(0).toUpperCase() + a[0].substr(1)];
} else { // default to zero for other 'auto'
val = 0;
Expand Down Expand Up @@ -220,7 +226,7 @@ YAHOO.util.Anim.prototype = {
* @private
* @type HTMLElement
*/
el = YAHOO.util.Dom.get(el);
el = Y.Dom.get(el);

/**
* The collection of attributes to be animated.
Expand All @@ -247,7 +253,7 @@ YAHOO.util.Anim.prototype = {
* @property method
* @type Function
*/
this.method = method || YAHOO.util.Easing.easeNone;
this.method = method || Y.Easing.easeNone;

/**
* Whether or not the duration should be treated as seconds.
Expand All @@ -271,14 +277,14 @@ YAHOO.util.Anim.prototype = {
* @property totalFrames
* @type Int
*/
this.totalFrames = YAHOO.util.AnimMgr.fps;
this.totalFrames = Y.AnimMgr.fps;

/**
* Changes the animated element
* @method setEl
*/
this.setEl = function(element) {
el = YAHOO.util.Dom.get(element);
el = Y.Dom.get(element);
};

/**
Expand Down Expand Up @@ -324,12 +330,12 @@ YAHOO.util.Anim.prototype = {

this.currentFrame = 0;

this.totalFrames = ( this.useSeconds ) ? Math.ceil(YAHOO.util.AnimMgr.fps * this.duration) : this.duration;
this.totalFrames = ( this.useSeconds ) ? Math.ceil(Y.AnimMgr.fps * this.duration) : this.duration;

if (this.duration === 0 && this.useSeconds) { // jump to last frame if zero second duration
this.totalFrames = 1;
}
YAHOO.util.AnimMgr.registerElement(this);
Y.AnimMgr.registerElement(this);
return true;
};

Expand All @@ -347,7 +353,7 @@ YAHOO.util.Anim.prototype = {
this.currentFrame = this.totalFrames;
this._onTween.fire();
}
YAHOO.util.AnimMgr.stop(this);
Y.AnimMgr.stop(this);
};

var onStart = function() {
Expand Down Expand Up @@ -418,46 +424,48 @@ YAHOO.util.Anim.prototype = {
* Custom event that fires after onStart, useful in subclassing
* @private
*/
this._onStart = new YAHOO.util.CustomEvent('_start', this, true);
this._onStart = new Y.CustomEvent('_start', this, true);

/**
* Custom event that fires when animation begins
* Listen via subscribe method (e.g. myAnim.onStart.subscribe(someFunction)
* @event onStart
*/
this.onStart = new YAHOO.util.CustomEvent('start', this);
this.onStart = new Y.CustomEvent('start', this);

/**
* Custom event that fires between each frame
* Listen via subscribe method (e.g. myAnim.onTween.subscribe(someFunction)
* @event onTween
*/
this.onTween = new YAHOO.util.CustomEvent('tween', this);
this.onTween = new Y.CustomEvent('tween', this);

/**
* Custom event that fires after onTween
* @private
*/
this._onTween = new YAHOO.util.CustomEvent('_tween', this, true);
this._onTween = new Y.CustomEvent('_tween', this, true);

/**
* Custom event that fires when animation ends
* Listen via subscribe method (e.g. myAnim.onComplete.subscribe(someFunction)
* @event onComplete
*/
this.onComplete = new YAHOO.util.CustomEvent('complete', this);
this.onComplete = new Y.CustomEvent('complete', this);
/**
* Custom event that fires after onComplete
* @private
*/
this._onComplete = new YAHOO.util.CustomEvent('_complete', this, true);
this._onComplete = new Y.CustomEvent('_complete', this, true);

this._onStart.subscribe(onStart);
this._onTween.subscribe(onTween);
this._onComplete.subscribe(onComplete);
}
};

Y.Anim = Anim;
})();
/**
* Handles animation queueing and threading.
* Used by Anim and subclasses.
Expand Down Expand Up @@ -696,23 +704,19 @@ YAHOO.util.Bezier = new function() {
* @param {Number} duration (optional, defaults to 1 second) Length of animation (frames or seconds), defaults to time-based
* @param {Function} method (optional, defaults to YAHOO.util.Easing.easeNone) Computes the values that are applied to the attributes per frame (generally a YAHOO.util.Easing method)
*/
YAHOO.util.ColorAnim = function(el, attributes, duration, method) {
YAHOO.util.ColorAnim.superclass.constructor.call(this, el, attributes, duration, method);
var ColorAnim = function(el, attributes, duration, method) {
ColorAnim.superclass.constructor.call(this, el, attributes, duration, method);
};

YAHOO.extend(YAHOO.util.ColorAnim, YAHOO.util.Anim);
ColorAnim.NAME = 'ColorAnim';

// shorthand
var Y = YAHOO.util;
var superclass = Y.ColorAnim.superclass;
var proto = Y.ColorAnim.prototype;

proto.toString = function() {
var el = this.getEl();
var id = el.id || el.tagName;
return ("ColorAnim " + id);
};
YAHOO.extend(ColorAnim, Y.Anim);

var superclass = ColorAnim.superclass;
var proto = ColorAnim.prototype;

proto.patterns.color = /color$/i;
proto.patterns.rgb = /^rgb\(([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\)$/i;
proto.patterns.hex = /^#?([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})$/i;
Expand Down Expand Up @@ -808,8 +812,10 @@ YAHOO.util.Bezier = new function() {
this.runtimeAttributes[attr].end = end;
}
};

Y.ColorAnim = ColorAnim;
})();
/*
/*!
TERMS OF USE - EASING EQUATIONS
Open source under the BSD License.
Copyright 2001 Robert Penner All rights reserved.
Expand Down Expand Up @@ -1159,7 +1165,7 @@ YAHOO.util.Easing = {
* @requires YAHOO.util.Event
* @requires YAHOO.util.CustomEvent
* @constructor
* @extends YAHOO.util.Anim
* @extends YAHOO.util.ColorAnim
* @param {String | HTMLElement} el Reference to the element that will be animated
* @param {Object} attributes The attribute(s) to be animated.
* Each attribute is an object with at minimum a "to" or "by" member defined.
Expand All @@ -1168,25 +1174,22 @@ YAHOO.util.Easing = {
* @param {Number} duration (optional, defaults to 1 second) Length of animation (frames or seconds), defaults to time-based
* @param {Function} method (optional, defaults to YAHOO.util.Easing.easeNone) Computes the values that are applied to the attributes per frame (generally a YAHOO.util.Easing method)
*/
YAHOO.util.Motion = function(el, attributes, duration, method) {
var Motion = function(el, attributes, duration, method) {
if (el) { // dont break existing subclasses not using YAHOO.extend
YAHOO.util.Motion.superclass.constructor.call(this, el, attributes, duration, method);
Motion.superclass.constructor.call(this, el, attributes, duration, method);
}
};

YAHOO.extend(YAHOO.util.Motion, YAHOO.util.ColorAnim);


Motion.NAME = 'Motion';

// shorthand
var Y = YAHOO.util;
var superclass = Y.Motion.superclass;
var proto = Y.Motion.prototype;

proto.toString = function() {
var el = this.getEl();
var id = el.id || el.tagName;
return ("Motion " + id);
};
YAHOO.extend(Motion, Y.ColorAnim);

var superclass = Motion.superclass;
var proto = Motion.prototype;

proto.patterns.points = /^points$/i;

proto.setAttribute = function(attr, val, unit) {
Expand Down Expand Up @@ -1295,6 +1298,8 @@ YAHOO.util.Easing = {
var isset = function(prop) {
return (typeof prop !== 'undefined');
};

Y.Motion = Motion;
})();
(function() {
/**
Expand All @@ -1310,7 +1315,7 @@ YAHOO.util.Easing = {
* @requires YAHOO.util.Dom
* @requires YAHOO.util.Event
* @requires YAHOO.util.CustomEvent
* @extends YAHOO.util.Anim
* @extends YAHOO.util.ColorAnim
* @constructor
* @param {String or HTMLElement} el Reference to the element that will be animated
* @param {Object} attributes The attribute(s) to be animated.
Expand All @@ -1320,24 +1325,20 @@ YAHOO.util.Easing = {
* @param {Number} duration (optional, defaults to 1 second) Length of animation (frames or seconds), defaults to time-based
* @param {Function} method (optional, defaults to YAHOO.util.Easing.easeNone) Computes the values that are applied to the attributes per frame (generally a YAHOO.util.Easing method)
*/
YAHOO.util.Scroll = function(el, attributes, duration, method) {
var Scroll = function(el, attributes, duration, method) {
if (el) { // dont break existing subclasses not using YAHOO.extend
YAHOO.util.Scroll.superclass.constructor.call(this, el, attributes, duration, method);
Scroll.superclass.constructor.call(this, el, attributes, duration, method);
}
};

YAHOO.extend(YAHOO.util.Scroll, YAHOO.util.ColorAnim);
Scroll.NAME = 'Scroll';

// shorthand
var Y = YAHOO.util;
var superclass = Y.Scroll.superclass;
var proto = Y.Scroll.prototype;

proto.toString = function() {
var el = this.getEl();
var id = el.id || el.tagName;
return ("Scroll " + id);
};
YAHOO.extend(Scroll, Y.ColorAnim);

var superclass = Scroll.superclass;
var proto = Scroll.prototype;

proto.doMethod = function(attr, start, end) {
var val = null;
Expand Down Expand Up @@ -1377,5 +1378,7 @@ YAHOO.util.Easing = {
superclass.setAttribute.call(this, attr, val, unit);
}
};

Y.Scroll = Scroll;
})();
YAHOO.register("animation", YAHOO.util.Anim, {version: "2.4.1", build: "742"});
YAHOO.register("animation", YAHOO.util.Anim, {version: "2.5.0", build: "895"});

0 comments on commit 381b098

Please sign in to comment.