Browse files

Complete build of every module with the new flattened directory struc…

…ture
  • Loading branch information...
1 parent d2854ac commit 76ca635d61eb3f9fb7c9d788a44fa8b1690aa138 @davglass davglass committed Jun 10, 2011
Showing with 19,630 additions and 19 deletions.
  1. +193 −0 build/align-plugin/align-plugin-debug.js
  2. +1 −0 build/align-plugin/align-plugin-min.js
  3. +193 −0 build/align-plugin/align-plugin.js
  4. +659 −0 build/anim-base/anim-base-debug.js
  5. +1 −0 build/anim-base/anim-base-min.js
  6. +658 −0 build/anim-base/anim-base.js
  7. +48 −0 build/anim-color/anim-color-debug.js
  8. +1 −0 build/anim-color/anim-color-min.js
  9. +48 −0 build/anim-color/anim-color.js
  10. +57 −0 build/anim-curve/anim-curve-debug.js
  11. +1 −0 build/anim-curve/anim-curve-min.js
  12. +57 −0 build/anim-curve/anim-curve.js
  13. +350 −0 build/anim-easing/anim-easing-debug.js
  14. +1 −0 build/anim-easing/anim-easing-min.js
  15. +350 −0 build/anim-easing/anim-easing.js
  16. +26 −0 build/anim-node-plugin/anim-node-plugin-debug.js
  17. +1 −0 build/anim-node-plugin/anim-node-plugin-min.js
  18. +26 −0 build/anim-node-plugin/anim-node-plugin.js
  19. +38 −0 build/anim-scroll/anim-scroll-debug.js
  20. +1 −0 build/anim-scroll/anim-scroll-min.js
  21. +38 −0 build/anim-scroll/anim-scroll.js
  22. +26 −0 build/anim-xy/anim-xy-debug.js
  23. +1 −0 build/anim-xy/anim-xy-min.js
  24. +26 −0 build/anim-xy/anim-xy.js
  25. +2 −2 build/anim/anim-min.js
  26. +350 −0 build/array-extras/array-extras-debug.js
  27. +1 −0 build/array-extras/array-extras-min.js
  28. +349 −0 build/array-extras/array-extras.js
  29. +44 −0 build/array-invoke/array-invoke-debug.js
  30. +1 −0 build/array-invoke/array-invoke-min.js
  31. +44 −0 build/array-invoke/array-invoke.js
  32. +81 −0 build/arraylist-add/arraylist-add-debug.js
  33. +1 −0 build/arraylist-add/arraylist-add-min.js
  34. +81 −0 build/arraylist-add/arraylist-add.js
  35. +43 −0 build/arraylist-filter/arraylist-filter-debug.js
  36. +1 −0 build/arraylist-filter/arraylist-filter-min.js
  37. +43 −0 build/arraylist-filter/arraylist-filter.js
  38. +207 −0 build/arraylist/arraylist-debug.js
  39. +1 −0 build/arraylist/arraylist-min.js
  40. +207 −0 build/arraylist/arraylist.js
  41. +1 −1 build/arraysort/arraysort-min.js
  42. +1,191 −0 build/attribute-base/attribute-base-debug.js
  43. +2 −0 build/attribute-base/attribute-base-min.js
  44. +1,176 −0 build/attribute-base/attribute-base.js
  45. +123 −0 build/attribute-complex/attribute-complex-debug.js
  46. +1 −0 build/attribute-complex/attribute-complex-min.js
  47. +123 −0 build/attribute-complex/attribute-complex.js
  48. +27 −0 build/autocomplete-base/assets/autocomplete-list-core.css
  49. +1,631 −0 build/autocomplete-base/autocomplete-base-debug.js
  50. +2 −0 build/autocomplete-base/autocomplete-base-min.js
  51. +1,624 −0 build/autocomplete-base/autocomplete-base.js
  52. +27 −0 build/autocomplete-filters-accentfold/assets/autocomplete-list-core.css
  53. +141 −0 build/autocomplete-filters-accentfold/autocomplete-filters-accentfold-debug.js
  54. +1 −0 build/autocomplete-filters-accentfold/autocomplete-filters-accentfold-min.js
  55. +141 −0 build/autocomplete-filters-accentfold/autocomplete-filters-accentfold.js
  56. +27 −0 build/autocomplete-filters/assets/autocomplete-list-core.css
  57. +239 −0 build/autocomplete-filters/autocomplete-filters-debug.js
  58. +1 −0 build/autocomplete-filters/autocomplete-filters-min.js
  59. +239 −0 build/autocomplete-filters/autocomplete-filters.js
  60. +27 −0 build/autocomplete-highlighters-accentfold/assets/autocomplete-list-core.css
  61. +121 −0 build/autocomplete-highlighters-accentfold/autocomplete-highlighters-accentfold-debug.js
  62. +1 −0 build/autocomplete-highlighters-accentfold/autocomplete-highlighters-accentfold-min.js
  63. +121 −0 build/autocomplete-highlighters-accentfold/autocomplete-highlighters-accentfold.js
  64. +27 −0 build/autocomplete-highlighters/assets/autocomplete-list-core.css
  65. +209 −0 build/autocomplete-highlighters/autocomplete-highlighters-debug.js
  66. +1 −0 build/autocomplete-highlighters/autocomplete-highlighters-min.js
  67. +209 −0 build/autocomplete-highlighters/autocomplete-highlighters.js
  68. +27 −0 build/autocomplete-list-keys/assets/autocomplete-list-core.css
  69. +188 −0 build/autocomplete-list-keys/autocomplete-list-keys-debug.js
  70. +1 −0 build/autocomplete-list-keys/autocomplete-list-keys-min.js
  71. +188 −0 build/autocomplete-list-keys/autocomplete-list-keys.js
  72. +27 −0 build/autocomplete-list/assets/autocomplete-list-core.css
  73. +17 −0 build/autocomplete-list/assets/skins/sam/autocomplete-list-skin.css
  74. +1 −0 build/autocomplete-list/assets/skins/sam/autocomplete-list.css
  75. +833 −0 build/autocomplete-list/autocomplete-list-debug.js
  76. +2 −0 build/autocomplete-list/autocomplete-list-min.js
  77. +833 −0 build/autocomplete-list/autocomplete-list.js
  78. +1 −0 build/autocomplete-list/lang/autocomplete-list.js
  79. +1 −0 build/autocomplete-list/lang/autocomplete-list_en.js
  80. +27 −0 build/autocomplete-plugin/assets/autocomplete-list-core.css
  81. +54 −0 build/autocomplete-plugin/autocomplete-plugin-debug.js
  82. +1 −0 build/autocomplete-plugin/autocomplete-plugin-min.js
  83. +54 −0 build/autocomplete-plugin/autocomplete-plugin.js
  84. +27 −0 build/autocomplete-sources/assets/autocomplete-list-core.css
  85. +480 −0 build/autocomplete-sources/autocomplete-sources-debug.js
  86. +1 −0 build/autocomplete-sources/autocomplete-sources-min.js
  87. +480 −0 build/autocomplete-sources/autocomplete-sources.js
  88. +1 −1 build/autocomplete/autocomplete-debug.js
  89. +1 −1 build/autocomplete/autocomplete-min.js
  90. +1 −1 build/autocomplete/autocomplete.js
  91. +610 −0 build/base-base/base-base-debug.js
  92. +1 −0 build/base-base/base-base-min.js
  93. +605 −0 build/base-base/base-base.js
  94. +322 −0 build/base-build/base-build-debug.js
  95. +1 −0 build/base-build/base-build-min.js
  96. +322 −0 build/base-build/base-build.js
  97. +36 −0 build/base-pluginhost/base-pluginhost-debug.js
  98. +1 −0 build/base-pluginhost/base-pluginhost-min.js
  99. +36 −0 build/base-pluginhost/base-pluginhost.js
  100. +388 −0 build/cache-base/cache-base-debug.js
  101. +1 −0 build/cache-base/cache-base-min.js
  102. +379 −0 build/cache-base/cache-base.js
  103. +334 −0 build/cache-offline/cache-offline-debug.js
  104. +1 −0 build/cache-offline/cache-offline-min.js
  105. +326 −0 build/cache-offline/cache-offline.js
  106. +46 −0 build/cache-plugin/cache-plugin-debug.js
  107. +1 −0 build/cache-plugin/cache-plugin-min.js
  108. +46 −0 build/cache-plugin/cache-plugin.js
  109. +0 −6 build/cache/cache-debug.js
  110. +1 −1 build/cache/cache-min.js
  111. +0 −6 build/cache/cache.js
  112. +31 −0 build/clickable-rail/assets/slider-base-core.css
  113. +31 −0 build/clickable-rail/assets/slider-core.css
  114. BIN build/clickable-rail/assets/thumb-x-oblong-dark.png
  115. BIN build/clickable-rail/assets/thumb-x-oblong.png
  116. BIN build/clickable-rail/assets/thumb-x-oblong2-dark.png
  117. BIN build/clickable-rail/assets/thumb-x-oblong2.png
  118. BIN build/clickable-rail/assets/thumb-y-oblong-dark.png
  119. BIN build/clickable-rail/assets/thumb-y-oblong.png
  120. BIN build/clickable-rail/assets/thumb-y-oblong2-dark.png
  121. BIN build/clickable-rail/assets/thumb-y-oblong2.png
  122. +211 −0 build/clickable-rail/clickable-rail-debug.js
  123. +1 −0 build/clickable-rail/clickable-rail-min.js
  124. +211 −0 build/clickable-rail/clickable-rail.js
  125. 0 build/console-filters/assets/console-filters-core.css
  126. +27 −0 build/console-filters/assets/skins/sam/console-filters-skin.css
  127. +1 −0 build/console-filters/assets/skins/sam/console-filters.css
  128. +723 −0 build/console-filters/console-filters-debug.js
  129. +1 −0 build/console-filters/console-filters-min.js
Sorry, we could not display the entire diff because too many files (895) changed.
View
193 build/align-plugin/align-plugin-debug.js
@@ -0,0 +1,193 @@
+YUI.add('align-plugin', function(Y) {
+
+ /**
+ * Provides advanced positioning support for Node via a Plugin
+ * for centering and alignment.
+ * @module align-plugin
+ */
+
+ var OFFSET_WIDTH = 'offsetWidth',
+ OFFSET_HEIGHT = 'offsetHeight',
+ undefined = undefined;
+
+ /**
+ * Node plugin which can be used to align a node with another node,
+ * region, or the viewport.
+ *
+ * @class Plugin.Align
+ * @param {Object} User configuration object
+ */
+ function Align(config) {
+ if (config.host) {
+ this._host = config.host;
+ }
+ }
+
+ Align.prototype = {
+ /**
+ * Aligns node with a point on another node or region.
+ * Possible alignment points are:
+ * <dl>
+ * <dt>tl</dt>
+ * <dd>top left</dd>
+ * <dt>tr</dt>
+ * <dd>top right</dd>
+ * <dt>bl</dt>
+ * <dd>bottom left</dd>
+ * <dt>br</dt>
+ * <dd>bottom right</dd>
+ * <dt>tc</dt>
+ * <dd>top center</dd>
+ * <dt>bc</dt>
+ * <dd>bottom center</dd>
+ * <dt>rc</dt>
+ * <dd>right center</dd>
+ * <dt>lc</dt>
+ * <dd>left center</dd>
+ * <dt>cc</dt>
+ * <dd>center center</dd>
+ * </dl>
+ * @method to
+ * @parm region {String || Node || HTMLElement || Object} The node or
+ * region to align with. Defaults to the viewport region.
+ * @parm regionPoint {String} The point of the region to align with.
+ * @parm point {String} The point of the node aligned to the region.
+ * @parm resize {Boolean} Whether or not the node should re-align when
+ * the window is resized. Defaults to false.
+ */
+ to: function(region, regionPoint, point, syncOnResize) {
+ // cache original args for syncing
+ this._syncArgs = Y.Array(arguments);
+
+ if (region.top === undefined) {
+ region = Y.one(region).get('region');
+ }
+
+ if (region) {
+ var xy = [region.left, region.top],
+ offxy = [region.width, region.height],
+ points = Align.points,
+ node = this._host,
+ NULL = null,
+ size = node.getAttrs([OFFSET_HEIGHT, OFFSET_WIDTH]),
+ nodeoff = [0 - size[OFFSET_WIDTH], 0 - size[OFFSET_HEIGHT]], // reverse offsets
+ regionFn0 = regionPoint ? points[regionPoint.charAt(0)]: NULL,
+ regionFn1 = (regionPoint && regionPoint !== 'cc') ? points[regionPoint.charAt(1)] : NULL,
+ nodeFn0 = point ? points[point.charAt(0)] : NULL,
+ nodeFn1 = (point && point !== 'cc') ? points[point.charAt(1)] : NULL;
+
+ if (regionFn0) {
+ xy = regionFn0(xy, offxy, regionPoint);
+ }
+ if (regionFn1) {
+ xy = regionFn1(xy, offxy, regionPoint);
+ }
+
+ if (nodeFn0) {
+ xy = nodeFn0(xy, nodeoff, point);
+ }
+ if (nodeFn1) {
+ xy = nodeFn1(xy, nodeoff, point);
+ }
+
+ if (xy && node) {
+ node.setXY(xy);
+ }
+
+ this._resize(syncOnResize);
+
+ }
+ return this;
+ },
+
+ sync: function() {
+ this.to.apply(this, this._syncArgs);
+ return this;
+ },
+
+ _resize: function(add) {
+ var handle = this._handle;
+ if (add && !handle) {
+ this._handle = Y.on('resize', this._onresize, window, this);
+ } else if (!add && handle) {
+ handle.detach();
+ }
+
+ },
+
+ _onresize: function() {
+ var self = this;
+ setTimeout(function() { // for performance
+ self.sync();
+ });
+ },
+
+ /**
+ * Aligns the center of a node to the center of another node or region.
+ * @method center
+ * @parm region {Node || HTMLElement || Object} optional The node or
+ * region to align with. Defaults to the viewport region.
+ * the window is resized. If centering to viewport, this defaults
+ * to true, otherwise default is false.
+ */
+ center: function(region, resize) {
+ this.to(region, 'cc', 'cc', resize);
+ return this;
+ },
+
+ /**
+ * Removes the resize handler, if any. This is called automatically
+ * when unplugged from the host node.
+ * @method destroy
+ */
+ destroy: function() {
+ var handle = this._handle;
+ if (handle) {
+ handle.detach();
+ }
+ }
+ };
+
+ Align.points = {
+ 't': function(xy, off) {
+ return xy;
+ },
+
+ 'r': function(xy, off) {
+ return [xy[0] + off[0], xy[1]];
+ },
+
+ 'b': function(xy, off) {
+ return [xy[0], xy[1] + off[1]];
+ },
+
+ 'l': function(xy, off) {
+ return xy;
+ },
+
+ 'c': function(xy, off, point) {
+ var axis = (point[0] === 't' || point[0] === 'b') ? 0 : 1,
+ ret, val;
+
+ if (point === 'cc') {
+ ret = [xy[0] + off[0] / 2, xy[1] + off[1] / 2];
+ } else {
+ val = xy[axis] + off[axis] / 2;
+ ret = (axis) ? [xy[0], val] : [val, xy[1]];
+ }
+
+ return ret;
+ }
+ };
+
+ Align.NAME = 'Align';
+ Align.NS = 'align';
+
+ Align.prototype.constructor = Align;
+
+ Y.namespace('Plugin');
+ Y.Plugin.Align = Align;
+
+
+
+}, '@VERSION@' ,{requires:['node-pluginhost', 'node-screen']});
View
1 build/align-plugin/align-plugin-min.js
@@ -0,0 +1 @@
+YUI.add("align-plugin",function(c){var e="offsetWidth",d="offsetHeight",b=b;function a(f){if(f.host){this._host=f.host;}}a.prototype={to:function(j,t,l,o){this._syncArgs=c.Array(arguments);if(j.top===b){j=c.one(j).get("region");}if(j){var s=[j.left,j.top],q=[j.width,j.height],n=a.points,f=this._host,h=null,r=f.getAttrs([d,e]),k=[0-r[e],0-r[d]],p=t?n[t.charAt(0)]:h,m=(t&&t!=="cc")?n[t.charAt(1)]:h,i=l?n[l.charAt(0)]:h,g=(l&&l!=="cc")?n[l.charAt(1)]:h;if(p){s=p(s,q,t);}if(m){s=m(s,q,t);}if(i){s=i(s,k,l);}if(g){s=g(s,k,l);}if(s&&f){f.setXY(s);}this._resize(o);}return this;},sync:function(){this.to.apply(this,this._syncArgs);return this;},_resize:function(g){var f=this._handle;if(g&&!f){this._handle=c.on("resize",this._onresize,window,this);}else{if(!g&&f){f.detach();}}},_onresize:function(){var f=this;setTimeout(function(){f.sync();});},center:function(g,f){this.to(g,"cc","cc",f);return this;},destroy:function(){var f=this._handle;if(f){f.detach();}}};a.points={"t":function(f,g){return f;},"r":function(f,g){return[f[0]+g[0],f[1]];},"b":function(f,g){return[f[0],f[1]+g[1]];},"l":function(f,g){return f;},"c":function(i,k,f){var h=(f[0]==="t"||f[0]==="b")?0:1,g,j;if(f==="cc"){g=[i[0]+k[0]/2,i[1]+k[1]/2];}else{j=i[h]+k[h]/2;g=(h)?[i[0],j]:[j,i[1]];}return g;}};a.NAME="Align";a.NS="align";a.prototype.constructor=a;c.namespace("Plugin");c.Plugin.Align=a;},"@VERSION@",{requires:["node-pluginhost","node-screen"]});
View
193 build/align-plugin/align-plugin.js
@@ -0,0 +1,193 @@
+YUI.add('align-plugin', function(Y) {
+
+ /**
+ * Provides advanced positioning support for Node via a Plugin
+ * for centering and alignment.
+ * @module align-plugin
+ */
+
+ var OFFSET_WIDTH = 'offsetWidth',
+ OFFSET_HEIGHT = 'offsetHeight',
+ undefined = undefined;
+
+ /**
+ * Node plugin which can be used to align a node with another node,
+ * region, or the viewport.
+ *
+ * @class Plugin.Align
+ * @param {Object} User configuration object
+ */
+ function Align(config) {
+ if (config.host) {
+ this._host = config.host;
+ }
+ }
+
+ Align.prototype = {
+ /**
+ * Aligns node with a point on another node or region.
+ * Possible alignment points are:
+ * <dl>
+ * <dt>tl</dt>
+ * <dd>top left</dd>
+ * <dt>tr</dt>
+ * <dd>top right</dd>
+ * <dt>bl</dt>
+ * <dd>bottom left</dd>
+ * <dt>br</dt>
+ * <dd>bottom right</dd>
+ * <dt>tc</dt>
+ * <dd>top center</dd>
+ * <dt>bc</dt>
+ * <dd>bottom center</dd>
+ * <dt>rc</dt>
+ * <dd>right center</dd>
+ * <dt>lc</dt>
+ * <dd>left center</dd>
+ * <dt>cc</dt>
+ * <dd>center center</dd>
+ * </dl>
+ * @method to
+ * @parm region {String || Node || HTMLElement || Object} The node or
+ * region to align with. Defaults to the viewport region.
+ * @parm regionPoint {String} The point of the region to align with.
+ * @parm point {String} The point of the node aligned to the region.
+ * @parm resize {Boolean} Whether or not the node should re-align when
+ * the window is resized. Defaults to false.
+ */
+ to: function(region, regionPoint, point, syncOnResize) {
+ // cache original args for syncing
+ this._syncArgs = Y.Array(arguments);
+
+ if (region.top === undefined) {
+ region = Y.one(region).get('region');
+ }
+
+ if (region) {
+ var xy = [region.left, region.top],
+ offxy = [region.width, region.height],
+ points = Align.points,
+ node = this._host,
+ NULL = null,
+ size = node.getAttrs([OFFSET_HEIGHT, OFFSET_WIDTH]),
+ nodeoff = [0 - size[OFFSET_WIDTH], 0 - size[OFFSET_HEIGHT]], // reverse offsets
+ regionFn0 = regionPoint ? points[regionPoint.charAt(0)]: NULL,
+ regionFn1 = (regionPoint && regionPoint !== 'cc') ? points[regionPoint.charAt(1)] : NULL,
+ nodeFn0 = point ? points[point.charAt(0)] : NULL,
+ nodeFn1 = (point && point !== 'cc') ? points[point.charAt(1)] : NULL;
+
+ if (regionFn0) {
+ xy = regionFn0(xy, offxy, regionPoint);
+ }
+ if (regionFn1) {
+ xy = regionFn1(xy, offxy, regionPoint);
+ }
+
+ if (nodeFn0) {
+ xy = nodeFn0(xy, nodeoff, point);
+ }
+ if (nodeFn1) {
+ xy = nodeFn1(xy, nodeoff, point);
+ }
+
+ if (xy && node) {
+ node.setXY(xy);
+ }
+
+ this._resize(syncOnResize);
+
+ }
+ return this;
+ },
+
+ sync: function() {
+ this.to.apply(this, this._syncArgs);
+ return this;
+ },
+
+ _resize: function(add) {
+ var handle = this._handle;
+ if (add && !handle) {
+ this._handle = Y.on('resize', this._onresize, window, this);
+ } else if (!add && handle) {
+ handle.detach();
+ }
+
+ },
+
+ _onresize: function() {
+ var self = this;
+ setTimeout(function() { // for performance
+ self.sync();
+ });
+ },
+
+ /**
+ * Aligns the center of a node to the center of another node or region.
+ * @method center
+ * @parm region {Node || HTMLElement || Object} optional The node or
+ * region to align with. Defaults to the viewport region.
+ * the window is resized. If centering to viewport, this defaults
+ * to true, otherwise default is false.
+ */
+ center: function(region, resize) {
+ this.to(region, 'cc', 'cc', resize);
+ return this;
+ },
+
+ /**
+ * Removes the resize handler, if any. This is called automatically
+ * when unplugged from the host node.
+ * @method destroy
+ */
+ destroy: function() {
+ var handle = this._handle;
+ if (handle) {
+ handle.detach();
+ }
+ }
+ };
+
+ Align.points = {
+ 't': function(xy, off) {
+ return xy;
+ },
+
+ 'r': function(xy, off) {
+ return [xy[0] + off[0], xy[1]];
+ },
+
+ 'b': function(xy, off) {
+ return [xy[0], xy[1] + off[1]];
+ },
+
+ 'l': function(xy, off) {
+ return xy;
+ },
+
+ 'c': function(xy, off, point) {
+ var axis = (point[0] === 't' || point[0] === 'b') ? 0 : 1,
+ ret, val;
+
+ if (point === 'cc') {
+ ret = [xy[0] + off[0] / 2, xy[1] + off[1] / 2];
+ } else {
+ val = xy[axis] + off[axis] / 2;
+ ret = (axis) ? [xy[0], val] : [val, xy[1]];
+ }
+
+ return ret;
+ }
+ };
+
+ Align.NAME = 'Align';
+ Align.NS = 'align';
+
+ Align.prototype.constructor = Align;
+
+ Y.namespace('Plugin');
+ Y.Plugin.Align = Align;
+
+
+
+}, '@VERSION@' ,{requires:['node-pluginhost', 'node-screen']});
View
659 build/anim-base/anim-base-debug.js
@@ -0,0 +1,659 @@
+YUI.add('anim-base', function(Y) {
+
+/**
+* The Animation Utility provides an API for creating advanced transitions.
+* @module anim
+*/
+
+/**
+* Provides the base Anim class, for animating numeric properties.
+*
+* @module anim
+* @submodule anim-base
+*/
+
+ /**
+ * A class for constructing animation instances.
+ * @class Anim
+ * @for Anim
+ * @constructor
+ * @extends Base
+ */
+
+ var RUNNING = 'running',
+ START_TIME = 'startTime',
+ ELAPSED_TIME = 'elapsedTime',
+ /**
+ * @for Anim
+ * @event start
+ * @description fires when an animation begins.
+ * @param {Event} ev The start event.
+ * @type Event.Custom
+ */
+ START = 'start',
+
+ /**
+ * @event tween
+ * @description fires every frame of the animation.
+ * @param {Event} ev The tween event.
+ * @type Event.Custom
+ */
+ TWEEN = 'tween',
+
+ /**
+ * @event end
+ * @description fires after the animation completes.
+ * @param {Event} ev The end event.
+ * @type Event.Custom
+ */
+ END = 'end',
+ NODE = 'node',
+ PAUSED = 'paused',
+ REVERSE = 'reverse', // TODO: cleanup
+ ITERATION_COUNT = 'iterationCount',
+
+ NUM = Number;
+
+ var _running = {},
+ _timer;
+
+ Y.Anim = function() {
+ Y.Anim.superclass.constructor.apply(this, arguments);
+ Y.Anim._instances[Y.stamp(this)] = this;
+ };
+
+ Y.Anim.NAME = 'anim';
+
+ Y.Anim._instances = {};
+
+ /**
+ * Regex of properties that should use the default unit.
+ *
+ * @property RE_DEFAULT_UNIT
+ * @static
+ */
+ Y.Anim.RE_DEFAULT_UNIT = /^width|height|top|right|bottom|left|margin.*|padding.*|border.*$/i;
+
+ /**
+ * The default unit to use with properties that pass the RE_DEFAULT_UNIT test.
+ *
+ * @property DEFAULT_UNIT
+ * @static
+ */
+ Y.Anim.DEFAULT_UNIT = 'px';
+
+ Y.Anim.DEFAULT_EASING = function (t, b, c, d) {
+ return c * t / d + b; // linear easing
+ };
+
+ /**
+ * Time in milliseconds passed to setInterval for frame processing
+ *
+ * @property intervalTime
+ * @default 20
+ * @static
+ */
+ Y.Anim._intervalTime = 20;
+
+ /**
+ * Bucket for custom getters and setters
+ *
+ * @property behaviors
+ * @static
+ */
+ Y.Anim.behaviors = {
+ left: {
+ get: function(anim, attr) {
+ return anim._getOffset(attr);
+ }
+ }
+ };
+
+ Y.Anim.behaviors.top = Y.Anim.behaviors.left;
+
+ /**
+ * The default setter to use when setting object properties.
+ *
+ * @property DEFAULT_SETTER
+ * @static
+ */
+ Y.Anim.DEFAULT_SETTER = function(anim, att, from, to, elapsed, duration, fn, unit) {
+ var node = anim._node,
+ val = fn(elapsed, NUM(from), NUM(to) - NUM(from), duration);
+
+ if (att in node._node.style || att in Y.DOM.CUSTOM_STYLES) {
+ unit = unit || '';
+ node.setStyle(att, val + unit);
+ } else if (node._node.attributes[att]) {
+ node.setAttribute(att, val);
+ } else {
+ node.set(att, val);
+ }
+ };
+
+ /**
+ * The default getter to use when getting object properties.
+ *
+ * @property DEFAULT_GETTER
+ * @static
+ */
+ Y.Anim.DEFAULT_GETTER = function(anim, att) {
+ var node = anim._node,
+ val = '';
+
+ if (att in node._node.style || att in Y.DOM.CUSTOM_STYLES) {
+ val = node.getComputedStyle(att);
+ } else if (node._node.attributes[att]) {
+ val = node.getAttribute(att);
+ } else {
+ val = node.get(att);
+ }
+
+ return val;
+ };
+
+ Y.Anim.ATTRS = {
+ /**
+ * The object to be animated.
+ * @attribute node
+ * @type Node
+ */
+ node: {
+ setter: function(node) {
+ node = Y.one(node);
+ this._node = node;
+ if (!node) {
+ Y.log(node + ' is not a valid node', 'warn', 'Anim');
+ }
+ return node;
+ }
+ },
+
+ /**
+ * The length of the animation. Defaults to "1" (second).
+ * @attribute duration
+ * @type NUM
+ */
+ duration: {
+ value: 1
+ },
+
+ /**
+ * The method that will provide values to the attribute(s) during the animation.
+ * Defaults to "Easing.easeNone".
+ * @attribute easing
+ * @type Function
+ */
+ easing: {
+ value: Y.Anim.DEFAULT_EASING,
+
+ setter: function(val) {
+ if (typeof val === 'string' && Y.Easing) {
+ return Y.Easing[val];
+ }
+ }
+ },
+
+ /**
+ * The starting values for the animated properties.
+ * Fields may be strings, numbers, or functions.
+ * If a function is used, the return value becomes the from value.
+ * If no from value is specified, the DEFAULT_GETTER will be used.
+ * @attribute from
+ * @type Object
+ * supports any unit, provided it matches the "to" (or default)
+ * unit (e.g. "{width: 10em', color: 'rgb(0, 0 0)', borderColor: '#ccc'}".
+ * If using the default ('px' for length-based units), the unit may be omitted (
+ * (e.g. "{width: 100}, borderColor: 'ccc'}", which defaults to pixels
+ * and hex, respectively).
+ */
+ from: {},
+
+ /**
+ * The ending values for the animated properties.
+ * Fields may be strings, numbers, or functions.
+ * @attribute to
+ * @type Object
+ * supports any unit, provided it matches the "from" (or default)
+ * unit (e.g. "{width: '50%', color: 'red', borderColor: '#ccc'}".
+ * If using the default ('px' for length-based units), the unit may be omitted (
+ * (e.g. "{width: 100}, borderColor: 'ccc'}", which defaults to pixels
+ * and hex, respectively).
+ */
+ to: {},
+
+ /**
+ * Date stamp for the first frame of the animation.
+ * @attribute startTime
+ * @type Int
+ * @default 0
+ * @readOnly
+ */
+ startTime: {
+ value: 0,
+ readOnly: true
+ },
+
+ /**
+ * Current time the animation has been running.
+ * @attribute elapsedTime
+ * @type Int
+ * @default 0
+ * @readOnly
+ */
+ elapsedTime: {
+ value: 0,
+ readOnly: true
+ },
+
+ /**
+ * Whether or not the animation is currently running.
+ * @attribute running
+ * @type Boolean
+ * @default false
+ * @readOnly
+ */
+ running: {
+ getter: function() {
+ return !!_running[Y.stamp(this)];
+ },
+ value: false,
+ readOnly: true
+ },
+
+ /**
+ * The number of times the animation should run
+ * @attribute iterations
+ * @type Int
+ * @default 1
+ */
+ iterations: {
+ value: 1
+ },
+
+ /**
+ * The number of iterations that have occurred.
+ * Resets when an animation ends (reaches iteration count or stop() called).
+ * @attribute iterationCount
+ * @type Int
+ * @default 0
+ * @readOnly
+ */
+ iterationCount: {
+ value: 0,
+ readOnly: true
+ },
+
+ /**
+ * How iterations of the animation should behave.
+ * Possible values are "normal" and "alternate".
+ * Normal will repeat the animation, alternate will reverse on every other pass.
+ *
+ * @attribute direction
+ * @type String
+ * @default "normal"
+ */
+ direction: {
+ value: 'normal' // | alternate (fwd on odd, rev on even per spec)
+ },
+
+ /**
+ * Whether or not the animation is currently paused.
+ * @attribute paused
+ * @type Boolean
+ * @default false
+ * @readOnly
+ */
+ paused: {
+ readOnly: true,
+ value: false
+ },
+
+ /**
+ * If true, animation begins from last frame
+ * @attribute reverse
+ * @type Boolean
+ * @default false
+ */
+ reverse: {
+ value: false
+ }
+
+
+ };
+
+ /**
+ * Runs all animation instances.
+ * @method run
+ * @static
+ */
+ Y.Anim.run = function() {
+ var instances = Y.Anim._instances;
+ for (var i in instances) {
+ if (instances[i].run) {
+ instances[i].run();
+ }
+ }
+ };
+
+ /**
+ * Pauses all animation instances.
+ * @method pause
+ * @static
+ */
+ Y.Anim.pause = function() {
+ for (var i in _running) { // stop timer if nothing running
+ if (_running[i].pause) {
+ _running[i].pause();
+ }
+ }
+
+ Y.Anim._stopTimer();
+ };
+
+ /**
+ * Stops all animation instances.
+ * @method stop
+ * @static
+ */
+ Y.Anim.stop = function() {
+ for (var i in _running) { // stop timer if nothing running
+ if (_running[i].stop) {
+ _running[i].stop();
+ }
+ }
+ Y.Anim._stopTimer();
+ };
+
+ Y.Anim._startTimer = function() {
+ if (!_timer) {
+ _timer = setInterval(Y.Anim._runFrame, Y.Anim._intervalTime);
+ }
+ };
+
+ Y.Anim._stopTimer = function() {
+ clearInterval(_timer);
+ _timer = 0;
+ };
+
+ /**
+ * Called per Interval to handle each animation frame.
+ * @method _runFrame
+ * @private
+ * @static
+ */
+ Y.Anim._runFrame = function() {
+ var done = true;
+ for (var anim in _running) {
+ if (_running[anim]._runFrame) {
+ done = false;
+ _running[anim]._runFrame();
+ }
+ }
+
+ if (done) {
+ Y.Anim._stopTimer();
+ }
+ };
+
+ Y.Anim.RE_UNITS = /^(-?\d*\.?\d*){1}(em|ex|px|in|cm|mm|pt|pc|%)*$/;
+
+ var proto = {
+ /**
+ * Starts or resumes an animation.
+ * @method run
+ * @chainable
+ */
+ run: function() {
+ if (this.get(PAUSED)) {
+ this._resume();
+ } else if (!this.get(RUNNING)) {
+ this._start();
+ }
+ return this;
+ },
+
+ /**
+ * Pauses the animation and
+ * freezes it in its current state and time.
+ * Calling run() will continue where it left off.
+ * @method pause
+ * @chainable
+ */
+ pause: function() {
+ if (this.get(RUNNING)) {
+ this._pause();
+ }
+ return this;
+ },
+
+ /**
+ * Stops the animation and resets its time.
+ * @method stop
+ * @param {Boolean} finish If true, the animation will move to the last frame
+ * @chainable
+ */
+ stop: function(finish) {
+ if (this.get(RUNNING) || this.get(PAUSED)) {
+ this._end(finish);
+ }
+ return this;
+ },
+
+ _added: false,
+
+ _start: function() {
+ this._set(START_TIME, new Date() - this.get(ELAPSED_TIME));
+ this._actualFrames = 0;
+ if (!this.get(PAUSED)) {
+ this._initAnimAttr();
+ }
+ _running[Y.stamp(this)] = this;
+ Y.Anim._startTimer();
+
+ this.fire(START);
+ },
+
+ _pause: function() {
+ this._set(START_TIME, null);
+ this._set(PAUSED, true);
+ delete _running[Y.stamp(this)];
+
+ /**
+ * @event pause
+ * @description fires when an animation is paused.
+ * @param {Event} ev The pause event.
+ * @type Event.Custom
+ */
+ this.fire('pause');
+ },
+
+ _resume: function() {
+ this._set(PAUSED, false);
+ _running[Y.stamp(this)] = this;
+ this._set(START_TIME, new Date() - this.get(ELAPSED_TIME));
+ Y.Anim._startTimer();
+
+ /**
+ * @event resume
+ * @description fires when an animation is resumed (run from pause).
+ * @param {Event} ev The pause event.
+ * @type Event.Custom
+ */
+ this.fire('resume');
+ },
+
+ _end: function(finish) {
+ var duration = this.get('duration') * 1000;
+ if (finish) { // jump to last frame
+ this._runAttrs(duration, duration, this.get(REVERSE));
+ }
+
+ this._set(START_TIME, null);
+ this._set(ELAPSED_TIME, 0);
+ this._set(PAUSED, false);
+
+ delete _running[Y.stamp(this)];
+ this.fire(END, {elapsed: this.get(ELAPSED_TIME)});
+ },
+
+ _runFrame: function() {
+ var d = this._runtimeAttr.duration,
+ t = new Date() - this.get(START_TIME),
+ reverse = this.get(REVERSE),
+ done = (t >= d),
+ attribute,
+ setter;
+
+ this._runAttrs(t, d, reverse);
+ this._actualFrames += 1;
+ this._set(ELAPSED_TIME, t);
+
+ this.fire(TWEEN);
+ if (done) {
+ this._lastFrame();
+ }
+ },
+
+ _runAttrs: function(t, d, reverse) {
+ var attr = this._runtimeAttr,
+ customAttr = Y.Anim.behaviors,
+ easing = attr.easing,
+ lastFrame = d,
+ done = false,
+ attribute,
+ setter,
+ i;
+
+ if (t >= d) {
+ done = true;
+ }
+
+ if (reverse) {
+ t = d - t;
+ lastFrame = 0;
+ }
+
+ for (i in attr) {
+ if (attr[i].to) {
+ attribute = attr[i];
+ setter = (i in customAttr && 'set' in customAttr[i]) ?
+ customAttr[i].set : Y.Anim.DEFAULT_SETTER;
+
+ if (!done) {
+ setter(this, i, attribute.from, attribute.to, t, d, easing, attribute.unit);
+ } else {
+ setter(this, i, attribute.from, attribute.to, lastFrame, d, easing, attribute.unit);
+ }
+ }
+ }
+
+
+ },
+
+ _lastFrame: function() {
+ var iter = this.get('iterations'),
+ iterCount = this.get(ITERATION_COUNT);
+
+ iterCount += 1;
+ if (iter === 'infinite' || iterCount < iter) {
+ if (this.get('direction') === 'alternate') {
+ this.set(REVERSE, !this.get(REVERSE)); // flip it
+ }
+ /**
+ * @event iteration
+ * @description fires when an animation begins an iteration.
+ * @param {Event} ev The iteration event.
+ * @type Event.Custom
+ */
+ this.fire('iteration');
+ } else {
+ iterCount = 0;
+ this._end();
+ }
+
+ this._set(START_TIME, new Date());
+ this._set(ITERATION_COUNT, iterCount);
+ },
+
+ _initAnimAttr: function() {
+ var from = this.get('from') || {},
+ to = this.get('to') || {},
+ attr = {
+ duration: this.get('duration') * 1000,
+ easing: this.get('easing')
+ },
+ customAttr = Y.Anim.behaviors,
+ node = this.get(NODE), // implicit attr init
+ unit, begin, end;
+
+ Y.each(to, function(val, name) {
+ if (typeof val === 'function') {
+ val = val.call(this, node);
+ }
+
+ begin = from[name];
+ if (begin === undefined) {
+ begin = (name in customAttr && 'get' in customAttr[name]) ?
+ customAttr[name].get(this, name) : Y.Anim.DEFAULT_GETTER(this, name);
+ } else if (typeof begin === 'function') {
+ begin = begin.call(this, node);
+ }
+
+ var mFrom = Y.Anim.RE_UNITS.exec(begin);
+ var mTo = Y.Anim.RE_UNITS.exec(val);
+
+ begin = mFrom ? mFrom[1] : begin;
+ end = mTo ? mTo[1] : val;
+ unit = mTo ? mTo[2] : mFrom ? mFrom[2] : ''; // one might be zero TODO: mixed units
+
+ if (!unit && Y.Anim.RE_DEFAULT_UNIT.test(name)) {
+ unit = Y.Anim.DEFAULT_UNIT;
+ }
+
+ if (!begin || !end) {
+ Y.error('invalid "from" or "to" for "' + name + '"', 'Anim');
+ return;
+ }
+
+ attr[name] = {
+ from: begin,
+ to: end,
+ unit: unit
+ };
+
+ }, this);
+
+ this._runtimeAttr = attr;
+ },
+
+
+ // TODO: move to computedStyle? (browsers dont agree on default computed offsets)
+ _getOffset: function(attr) {
+ var node = this._node,
+ val = node.getComputedStyle(attr),
+ get = (attr === 'left') ? 'getX': 'getY',
+ set = (attr === 'left') ? 'setX': 'setY';
+
+ if (val === 'auto') {
+ var position = node.getStyle('position');
+ if (position === 'absolute' || position === 'fixed') {
+ val = node[get]();
+ node[set](val);
+ } else {
+ val = 0;
+ }
+ }
+
+ return val;
+ },
+
+ destructor: function() {
+ delete Y.Anim._instances[Y.stamp(this)];
+ }
+ };
+
+ Y.extend(Y.Anim, Y.Base, proto);
+
+
+}, '@VERSION@' ,{requires:['base-base', 'node-style']});
View
1 build/anim-base/anim-base-min.js
@@ -0,0 +1 @@
+YUI.add("anim-base",function(b){var c="running",n="startTime",l="elapsedTime",j="start",i="tween",m="end",d="node",k="paused",o="reverse",h="iterationCount",a=Number;var f={},e;b.Anim=function(){b.Anim.superclass.constructor.apply(this,arguments);b.Anim._instances[b.stamp(this)]=this;};b.Anim.NAME="anim";b.Anim._instances={};b.Anim.RE_DEFAULT_UNIT=/^width|height|top|right|bottom|left|margin.*|padding.*|border.*$/i;b.Anim.DEFAULT_UNIT="px";b.Anim.DEFAULT_EASING=function(q,p,s,r){return s*q/r+p;};b.Anim._intervalTime=20;b.Anim.behaviors={left:{get:function(q,p){return q._getOffset(p);}}};b.Anim.behaviors.top=b.Anim.behaviors.left;b.Anim.DEFAULT_SETTER=function(s,t,v,w,y,r,u,x){var q=s._node,p=u(y,a(v),a(w)-a(v),r);if(t in q._node.style||t in b.DOM.CUSTOM_STYLES){x=x||"";q.setStyle(t,p+x);}else{if(q._node.attributes[t]){q.setAttribute(t,p);}else{q.set(t,p);}}};b.Anim.DEFAULT_GETTER=function(r,p){var q=r._node,s="";if(p in q._node.style||p in b.DOM.CUSTOM_STYLES){s=q.getComputedStyle(p);}else{if(q._node.attributes[p]){s=q.getAttribute(p);}else{s=q.get(p);}}return s;};b.Anim.ATTRS={node:{setter:function(p){p=b.one(p);this._node=p;if(!p){}return p;}},duration:{value:1},easing:{value:b.Anim.DEFAULT_EASING,setter:function(p){if(typeof p==="string"&&b.Easing){return b.Easing[p];}}},from:{},to:{},startTime:{value:0,readOnly:true},elapsedTime:{value:0,readOnly:true},running:{getter:function(){return !!f[b.stamp(this)];},value:false,readOnly:true},iterations:{value:1},iterationCount:{value:0,readOnly:true},direction:{value:"normal"},paused:{readOnly:true,value:false},reverse:{value:false}};b.Anim.run=function(){var q=b.Anim._instances;for(var p in q){if(q[p].run){q[p].run();}}};b.Anim.pause=function(){for(var p in f){if(f[p].pause){f[p].pause();}}b.Anim._stopTimer();};b.Anim.stop=function(){for(var p in f){if(f[p].stop){f[p].stop();}}b.Anim._stopTimer();};b.Anim._startTimer=function(){if(!e){e=setInterval(b.Anim._runFrame,b.Anim._intervalTime);}};b.Anim._stopTimer=function(){clearInterval(e);e=0;};b.Anim._runFrame=function(){var p=true;for(var q in f){if(f[q]._runFrame){p=false;f[q]._runFrame();}}if(p){b.Anim._stopTimer();}};b.Anim.RE_UNITS=/^(-?\d*\.?\d*){1}(em|ex|px|in|cm|mm|pt|pc|%)*$/;var g={run:function(){if(this.get(k)){this._resume();}else{if(!this.get(c)){this._start();}}return this;},pause:function(){if(this.get(c)){this._pause();}return this;},stop:function(p){if(this.get(c)||this.get(k)){this._end(p);}return this;},_added:false,_start:function(){this._set(n,new Date()-this.get(l));this._actualFrames=0;if(!this.get(k)){this._initAnimAttr();}f[b.stamp(this)]=this;b.Anim._startTimer();this.fire(j);},_pause:function(){this._set(n,null);this._set(k,true);delete f[b.stamp(this)];this.fire("pause");},_resume:function(){this._set(k,false);f[b.stamp(this)]=this;this._set(n,new Date()-this.get(l));b.Anim._startTimer();this.fire("resume");},_end:function(p){var q=this.get("duration")*1000;if(p){this._runAttrs(q,q,this.get(o));}this._set(n,null);this._set(l,0);this._set(k,false);delete f[b.stamp(this)];this.fire(m,{elapsed:this.get(l)});},_runFrame:function(){var u=this._runtimeAttr.duration,r=new Date()-this.get(n),q=this.get(o),p=(r>=u),s,v;this._runAttrs(r,u,q);this._actualFrames+=1;this._set(l,r);this.fire(i);if(p){this._lastFrame();}},_runAttrs:function(A,z,w){var x=this._runtimeAttr,r=b.Anim.behaviors,y=x.easing,p=z,u=false,q,s,v;if(A>=z){u=true;}if(w){A=z-A;p=0;}for(v in x){if(x[v].to){q=x[v];s=(v in r&&"set" in r[v])?r[v].set:b.Anim.DEFAULT_SETTER;if(!u){s(this,v,q.from,q.to,A,z,y,q.unit);}else{s(this,v,q.from,q.to,p,z,y,q.unit);}}}},_lastFrame:function(){var p=this.get("iterations"),q=this.get(h);q+=1;if(p==="infinite"||q<p){if(this.get("direction")==="alternate"){this.set(o,!this.get(o));}this.fire("iteration");}else{q=0;this._end();}this._set(n,new Date());this._set(h,q);},_initAnimAttr:function(){var w=this.get("from")||{},v=this.get("to")||{},p={duration:this.get("duration")*1000,easing:this.get("easing")},r=b.Anim.behaviors,u=this.get(d),t,s,q;b.each(v,function(A,y){if(typeof A==="function"){A=A.call(this,u);}s=w[y];if(s===undefined){s=(y in r&&"get" in r[y])?r[y].get(this,y):b.Anim.DEFAULT_GETTER(this,y);}else{if(typeof s==="function"){s=s.call(this,u);}}var x=b.Anim.RE_UNITS.exec(s);var z=b.Anim.RE_UNITS.exec(A);s=x?x[1]:s;q=z?z[1]:A;t=z?z[2]:x?x[2]:"";if(!t&&b.Anim.RE_DEFAULT_UNIT.test(y)){t=b.Anim.DEFAULT_UNIT;}if(!s||!q){b.error('invalid "from" or "to" for "'+y+'"',"Anim");return;}p[y]={from:s,to:q,unit:t};},this);this._runtimeAttr=p;},_getOffset:function(q){var s=this._node,t=s.getComputedStyle(q),r=(q==="left")?"getX":"getY",u=(q==="left")?"setX":"setY";if(t==="auto"){var p=s.getStyle("position");if(p==="absolute"||p==="fixed"){t=s[r]();s[u](t);}else{t=0;}}return t;},destructor:function(){delete b.Anim._instances[b.stamp(this)];}};b.extend(b.Anim,b.Base,g);},"@VERSION@",{requires:["base-base","node-style"]});
View
658 build/anim-base/anim-base.js
@@ -0,0 +1,658 @@
+YUI.add('anim-base', function(Y) {
+
+/**
+* The Animation Utility provides an API for creating advanced transitions.
+* @module anim
+*/
+
+/**
+* Provides the base Anim class, for animating numeric properties.
+*
+* @module anim
+* @submodule anim-base
+*/
+
+ /**
+ * A class for constructing animation instances.
+ * @class Anim
+ * @for Anim
+ * @constructor
+ * @extends Base
+ */
+
+ var RUNNING = 'running',
+ START_TIME = 'startTime',
+ ELAPSED_TIME = 'elapsedTime',
+ /**
+ * @for Anim
+ * @event start
+ * @description fires when an animation begins.
+ * @param {Event} ev The start event.
+ * @type Event.Custom
+ */
+ START = 'start',
+
+ /**
+ * @event tween
+ * @description fires every frame of the animation.
+ * @param {Event} ev The tween event.
+ * @type Event.Custom
+ */
+ TWEEN = 'tween',
+
+ /**
+ * @event end
+ * @description fires after the animation completes.
+ * @param {Event} ev The end event.
+ * @type Event.Custom
+ */
+ END = 'end',
+ NODE = 'node',
+ PAUSED = 'paused',
+ REVERSE = 'reverse', // TODO: cleanup
+ ITERATION_COUNT = 'iterationCount',
+
+ NUM = Number;
+
+ var _running = {},
+ _timer;
+
+ Y.Anim = function() {
+ Y.Anim.superclass.constructor.apply(this, arguments);
+ Y.Anim._instances[Y.stamp(this)] = this;
+ };
+
+ Y.Anim.NAME = 'anim';
+
+ Y.Anim._instances = {};
+
+ /**
+ * Regex of properties that should use the default unit.
+ *
+ * @property RE_DEFAULT_UNIT
+ * @static
+ */
+ Y.Anim.RE_DEFAULT_UNIT = /^width|height|top|right|bottom|left|margin.*|padding.*|border.*$/i;
+
+ /**
+ * The default unit to use with properties that pass the RE_DEFAULT_UNIT test.
+ *
+ * @property DEFAULT_UNIT
+ * @static
+ */
+ Y.Anim.DEFAULT_UNIT = 'px';
+
+ Y.Anim.DEFAULT_EASING = function (t, b, c, d) {
+ return c * t / d + b; // linear easing
+ };
+
+ /**
+ * Time in milliseconds passed to setInterval for frame processing
+ *
+ * @property intervalTime
+ * @default 20
+ * @static
+ */
+ Y.Anim._intervalTime = 20;
+
+ /**
+ * Bucket for custom getters and setters
+ *
+ * @property behaviors
+ * @static
+ */
+ Y.Anim.behaviors = {
+ left: {
+ get: function(anim, attr) {
+ return anim._getOffset(attr);
+ }
+ }
+ };
+
+ Y.Anim.behaviors.top = Y.Anim.behaviors.left;
+
+ /**
+ * The default setter to use when setting object properties.
+ *
+ * @property DEFAULT_SETTER
+ * @static
+ */
+ Y.Anim.DEFAULT_SETTER = function(anim, att, from, to, elapsed, duration, fn, unit) {
+ var node = anim._node,
+ val = fn(elapsed, NUM(from), NUM(to) - NUM(from), duration);
+
+ if (att in node._node.style || att in Y.DOM.CUSTOM_STYLES) {
+ unit = unit || '';
+ node.setStyle(att, val + unit);
+ } else if (node._node.attributes[att]) {
+ node.setAttribute(att, val);
+ } else {
+ node.set(att, val);
+ }
+ };
+
+ /**
+ * The default getter to use when getting object properties.
+ *
+ * @property DEFAULT_GETTER
+ * @static
+ */
+ Y.Anim.DEFAULT_GETTER = function(anim, att) {
+ var node = anim._node,
+ val = '';
+
+ if (att in node._node.style || att in Y.DOM.CUSTOM_STYLES) {
+ val = node.getComputedStyle(att);
+ } else if (node._node.attributes[att]) {
+ val = node.getAttribute(att);
+ } else {
+ val = node.get(att);
+ }
+
+ return val;
+ };
+
+ Y.Anim.ATTRS = {
+ /**
+ * The object to be animated.
+ * @attribute node
+ * @type Node
+ */
+ node: {
+ setter: function(node) {
+ node = Y.one(node);
+ this._node = node;
+ if (!node) {
+ }
+ return node;
+ }
+ },
+
+ /**
+ * The length of the animation. Defaults to "1" (second).
+ * @attribute duration
+ * @type NUM
+ */
+ duration: {
+ value: 1
+ },
+
+ /**
+ * The method that will provide values to the attribute(s) during the animation.
+ * Defaults to "Easing.easeNone".
+ * @attribute easing
+ * @type Function
+ */
+ easing: {
+ value: Y.Anim.DEFAULT_EASING,
+
+ setter: function(val) {
+ if (typeof val === 'string' && Y.Easing) {
+ return Y.Easing[val];
+ }
+ }
+ },
+
+ /**
+ * The starting values for the animated properties.
+ * Fields may be strings, numbers, or functions.
+ * If a function is used, the return value becomes the from value.
+ * If no from value is specified, the DEFAULT_GETTER will be used.
+ * @attribute from
+ * @type Object
+ * supports any unit, provided it matches the "to" (or default)
+ * unit (e.g. "{width: 10em', color: 'rgb(0, 0 0)', borderColor: '#ccc'}".
+ * If using the default ('px' for length-based units), the unit may be omitted (
+ * (e.g. "{width: 100}, borderColor: 'ccc'}", which defaults to pixels
+ * and hex, respectively).
+ */
+ from: {},
+
+ /**
+ * The ending values for the animated properties.
+ * Fields may be strings, numbers, or functions.
+ * @attribute to
+ * @type Object
+ * supports any unit, provided it matches the "from" (or default)
+ * unit (e.g. "{width: '50%', color: 'red', borderColor: '#ccc'}".
+ * If using the default ('px' for length-based units), the unit may be omitted (
+ * (e.g. "{width: 100}, borderColor: 'ccc'}", which defaults to pixels
+ * and hex, respectively).
+ */
+ to: {},
+
+ /**
+ * Date stamp for the first frame of the animation.
+ * @attribute startTime
+ * @type Int
+ * @default 0
+ * @readOnly
+ */
+ startTime: {
+ value: 0,
+ readOnly: true
+ },
+
+ /**
+ * Current time the animation has been running.
+ * @attribute elapsedTime
+ * @type Int
+ * @default 0
+ * @readOnly
+ */
+ elapsedTime: {
+ value: 0,
+ readOnly: true
+ },
+
+ /**
+ * Whether or not the animation is currently running.
+ * @attribute running
+ * @type Boolean
+ * @default false
+ * @readOnly
+ */
+ running: {
+ getter: function() {
+ return !!_running[Y.stamp(this)];
+ },
+ value: false,
+ readOnly: true
+ },
+
+ /**
+ * The number of times the animation should run
+ * @attribute iterations
+ * @type Int
+ * @default 1
+ */
+ iterations: {
+ value: 1
+ },
+
+ /**
+ * The number of iterations that have occurred.
+ * Resets when an animation ends (reaches iteration count or stop() called).
+ * @attribute iterationCount
+ * @type Int
+ * @default 0
+ * @readOnly
+ */
+ iterationCount: {
+ value: 0,
+ readOnly: true
+ },
+
+ /**
+ * How iterations of the animation should behave.
+ * Possible values are "normal" and "alternate".
+ * Normal will repeat the animation, alternate will reverse on every other pass.
+ *
+ * @attribute direction
+ * @type String
+ * @default "normal"
+ */
+ direction: {
+ value: 'normal' // | alternate (fwd on odd, rev on even per spec)
+ },
+
+ /**
+ * Whether or not the animation is currently paused.
+ * @attribute paused
+ * @type Boolean
+ * @default false
+ * @readOnly
+ */
+ paused: {
+ readOnly: true,
+ value: false
+ },
+
+ /**
+ * If true, animation begins from last frame
+ * @attribute reverse
+ * @type Boolean
+ * @default false
+ */
+ reverse: {
+ value: false
+ }
+
+
+ };
+
+ /**
+ * Runs all animation instances.
+ * @method run
+ * @static
+ */
+ Y.Anim.run = function() {
+ var instances = Y.Anim._instances;
+ for (var i in instances) {
+ if (instances[i].run) {
+ instances[i].run();
+ }
+ }
+ };
+
+ /**
+ * Pauses all animation instances.
+ * @method pause
+ * @static
+ */
+ Y.Anim.pause = function() {
+ for (var i in _running) { // stop timer if nothing running
+ if (_running[i].pause) {
+ _running[i].pause();
+ }
+ }
+
+ Y.Anim._stopTimer();
+ };
+
+ /**
+ * Stops all animation instances.
+ * @method stop
+ * @static
+ */
+ Y.Anim.stop = function() {
+ for (var i in _running) { // stop timer if nothing running
+ if (_running[i].stop) {
+ _running[i].stop();
+ }
+ }
+ Y.Anim._stopTimer();
+ };
+
+ Y.Anim._startTimer = function() {
+ if (!_timer) {
+ _timer = setInterval(Y.Anim._runFrame, Y.Anim._intervalTime);
+ }
+ };
+
+ Y.Anim._stopTimer = function() {
+ clearInterval(_timer);
+ _timer = 0;
+ };
+
+ /**
+ * Called per Interval to handle each animation frame.
+ * @method _runFrame
+ * @private
+ * @static
+ */
+ Y.Anim._runFrame = function() {
+ var done = true;
+ for (var anim in _running) {
+ if (_running[anim]._runFrame) {
+ done = false;
+ _running[anim]._runFrame();
+ }
+ }
+
+ if (done) {
+ Y.Anim._stopTimer();
+ }
+ };
+
+ Y.Anim.RE_UNITS = /^(-?\d*\.?\d*){1}(em|ex|px|in|cm|mm|pt|pc|%)*$/;
+
+ var proto = {
+ /**
+ * Starts or resumes an animation.
+ * @method run
+ * @chainable
+ */
+ run: function() {
+ if (this.get(PAUSED)) {
+ this._resume();
+ } else if (!this.get(RUNNING)) {
+ this._start();
+ }
+ return this;
+ },
+
+ /**
+ * Pauses the animation and
+ * freezes it in its current state and time.
+ * Calling run() will continue where it left off.
+ * @method pause
+ * @chainable
+ */
+ pause: function() {
+ if (this.get(RUNNING)) {
+ this._pause();
+ }
+ return this;
+ },
+
+ /**
+ * Stops the animation and resets its time.
+ * @method stop
+ * @param {Boolean} finish If true, the animation will move to the last frame
+ * @chainable
+ */
+ stop: function(finish) {
+ if (this.get(RUNNING) || this.get(PAUSED)) {
+ this._end(finish);
+ }
+ return this;
+ },
+
+ _added: false,
+
+ _start: function() {
+ this._set(START_TIME, new Date() - this.get(ELAPSED_TIME));
+ this._actualFrames = 0;
+ if (!this.get(PAUSED)) {
+ this._initAnimAttr();
+ }
+ _running[Y.stamp(this)] = this;
+ Y.Anim._startTimer();
+
+ this.fire(START);
+ },
+
+ _pause: function() {
+ this._set(START_TIME, null);
+ this._set(PAUSED, true);
+ delete _running[Y.stamp(this)];
+
+ /**
+ * @event pause
+ * @description fires when an animation is paused.
+ * @param {Event} ev The pause event.
+ * @type Event.Custom
+ */
+ this.fire('pause');
+ },
+
+ _resume: function() {
+ this._set(PAUSED, false);
+ _running[Y.stamp(this)] = this;
+ this._set(START_TIME, new Date() - this.get(ELAPSED_TIME));
+ Y.Anim._startTimer();
+
+ /**
+ * @event resume
+ * @description fires when an animation is resumed (run from pause).
+ * @param {Event} ev The pause event.
+ * @type Event.Custom
+ */
+ this.fire('resume');
+ },
+
+ _end: function(finish) {
+ var duration = this.get('duration') * 1000;
+ if (finish) { // jump to last frame
+ this._runAttrs(duration, duration, this.get(REVERSE));
+ }
+
+ this._set(START_TIME, null);
+ this._set(ELAPSED_TIME, 0);
+ this._set(PAUSED, false);
+
+ delete _running[Y.stamp(this)];
+ this.fire(END, {elapsed: this.get(ELAPSED_TIME)});
+ },
+
+ _runFrame: function() {
+ var d = this._runtimeAttr.duration,
+ t = new Date() - this.get(START_TIME),
+ reverse = this.get(REVERSE),
+ done = (t >= d),
+ attribute,
+ setter;
+
+ this._runAttrs(t, d, reverse);
+ this._actualFrames += 1;
+ this._set(ELAPSED_TIME, t);
+
+ this.fire(TWEEN);
+ if (done) {
+ this._lastFrame();
+ }
+ },
+
+ _runAttrs: function(t, d, reverse) {
+ var attr = this._runtimeAttr,
+ customAttr = Y.Anim.behaviors,
+ easing = attr.easing,
+ lastFrame = d,
+ done = false,
+ attribute,
+ setter,
+ i;
+
+ if (t >= d) {
+ done = true;
+ }
+
+ if (reverse) {
+ t = d - t;
+ lastFrame = 0;
+ }
+
+ for (i in attr) {
+ if (attr[i].to) {
+ attribute = attr[i];
+ setter = (i in customAttr && 'set' in customAttr[i]) ?
+ customAttr[i].set : Y.Anim.DEFAULT_SETTER;
+
+ if (!done) {
+ setter(this, i, attribute.from, attribute.to, t, d, easing, attribute.unit);
+ } else {
+ setter(this, i, attribute.from, attribute.to, lastFrame, d, easing, attribute.unit);
+ }
+ }
+ }
+
+
+ },
+
+ _lastFrame: function() {
+ var iter = this.get('iterations'),
+ iterCount = this.get(ITERATION_COUNT);
+
+ iterCount += 1;
+ if (iter === 'infinite' || iterCount < iter) {
+ if (this.get('direction') === 'alternate') {
+ this.set(REVERSE, !this.get(REVERSE)); // flip it
+ }
+ /**
+ * @event iteration
+ * @description fires when an animation begins an iteration.
+ * @param {Event} ev The iteration event.
+ * @type Event.Custom
+ */
+ this.fire('iteration');
+ } else {
+ iterCount = 0;
+ this._end();
+ }
+
+ this._set(START_TIME, new Date());
+ this._set(ITERATION_COUNT, iterCount);
+ },
+
+ _initAnimAttr: function() {
+ var from = this.get('from') || {},
+ to = this.get('to') || {},
+ attr = {
+ duration: this.get('duration') * 1000,
+ easing: this.get('easing')
+ },
+ customAttr = Y.Anim.behaviors,
+ node = this.get(NODE), // implicit attr init
+ unit, begin, end;
+
+ Y.each(to, function(val, name) {
+ if (typeof val === 'function') {
+ val = val.call(this, node);
+ }
+
+ begin = from[name];
+ if (begin === undefined) {
+ begin = (name in customAttr && 'get' in customAttr[name]) ?
+ customAttr[name].get(this, name) : Y.Anim.DEFAULT_GETTER(this, name);
+ } else if (typeof begin === 'function') {
+ begin = begin.call(this, node);
+ }
+
+ var mFrom = Y.Anim.RE_UNITS.exec(begin);
+ var mTo = Y.Anim.RE_UNITS.exec(val);
+
+ begin = mFrom ? mFrom[1] : begin;
+ end = mTo ? mTo[1] : val;
+ unit = mTo ? mTo[2] : mFrom ? mFrom[2] : ''; // one might be zero TODO: mixed units
+
+ if (!unit && Y.Anim.RE_DEFAULT_UNIT.test(name)) {
+ unit = Y.Anim.DEFAULT_UNIT;
+ }
+
+ if (!begin || !end) {
+ Y.error('invalid "from" or "to" for "' + name + '"', 'Anim');
+ return;
+ }
+
+ attr[name] = {
+ from: begin,
+ to: end,
+ unit: unit
+ };
+
+ }, this);
+
+ this._runtimeAttr = attr;
+ },
+
+
+ // TODO: move to computedStyle? (browsers dont agree on default computed offsets)
+ _getOffset: function(attr) {
+ var node = this._node,
+ val = node.getComputedStyle(attr),
+ get = (attr === 'left') ? 'getX': 'getY',
+ set = (attr === 'left') ? 'setX': 'setY';
+
+ if (val === 'auto') {
+ var position = node.getStyle('position');
+ if (position === 'absolute' || position === 'fixed') {
+ val = node[get]();
+ node[set](val);
+ } else {
+ val = 0;
+ }
+ }
+
+ return val;
+ },
+
+ destructor: function() {
+ delete Y.Anim._instances[Y.stamp(this)];
+ }
+ };
+
+ Y.extend(Y.Anim, Y.Base, proto);
+
+
+}, '@VERSION@' ,{requires:['base-base', 'node-style']});
View
48 build/anim-color/anim-color-debug.js
@@ -0,0 +1,48 @@
+YUI.add('anim-color', function(Y) {
+
+/**
+ * Adds support for color properties in <code>to</code>
+ * and <code>from</code> attributes.
+ * @module anim
+ * @submodule anim-color
+ */
+
+var NUM = Number;
+
+Y.Anim.behaviors.color = {
+ set: function(anim, att, from, to, elapsed, duration, fn) {
+ from = Y.Color.re_RGB.exec(Y.Color.toRGB(from));
+ to = Y.Color.re_RGB.exec(Y.Color.toRGB(to));
+
+ if (!from || from.length < 3 || !to || to.length < 3) {
+ Y.error('invalid from or to passed to color behavior');
+ }
+
+ anim._node.setStyle(att, 'rgb(' + [
+ Math.floor(fn(elapsed, NUM(from[1]), NUM(to[1]) - NUM(from[1]), duration)),
+ Math.floor(fn(elapsed, NUM(from[2]), NUM(to[2]) - NUM(from[2]), duration)),
+ Math.floor(fn(elapsed, NUM(from[3]), NUM(to[3]) - NUM(from[3]), duration))
+ ].join(', ') + ')');
+ },
+
+ // TODO: default bgcolor const
+ get: function(anim, att) {
+ var val = anim._node.getComputedStyle(att);
+ val = (val === 'transparent') ? 'rgb(255, 255, 255)' : val;
+ return val;
+ }
+};
+
+Y.each(['backgroundColor',
+ 'borderColor',
+ 'borderTopColor',
+ 'borderRightColor',
+ 'borderBottomColor',
+ 'borderLeftColor'],
+ function(v, i) {
+ Y.Anim.behaviors[v] = Y.Anim.behaviors.color;
+ }
+);
+
+
+}, '@VERSION@' ,{requires:['anim-base']});
View
1 build/anim-color/anim-color-min.js
@@ -0,0 +1 @@
+YUI.add("anim-color",function(b){var a=Number;b.Anim.behaviors.color={set:function(f,d,i,h,c,g,e){i=b.Color.re_RGB.exec(b.Color.toRGB(i));h=b.Color.re_RGB.exec(b.Color.toRGB(h));if(!i||i.length<3||!h||h.length<3){b.error("invalid from or to passed to color behavior");}f._node.setStyle(d,"rgb("+[Math.floor(e(c,a(i[1]),a(h[1])-a(i[1]),g)),Math.floor(e(c,a(i[2]),a(h[2])-a(i[2]),g)),Math.floor(e(c,a(i[3]),a(h[3])-a(i[3]),g))].join(", ")+")");},get:function(d,c){var e=d._node.getComputedStyle(c);e=(e==="transparent")?"rgb(255, 255, 255)":e;return e;}};b.each(["backgroundColor","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"],function(c,d){b.Anim.behaviors[c]=b.Anim.behaviors.color;});},"@VERSION@",{requires:["anim-base"]});
View
48 build/anim-color/anim-color.js
@@ -0,0 +1,48 @@
+YUI.add('anim-color', function(Y) {
+
+/**
+ * Adds support for color properties in <code>to</code>
+ * and <code>from</code> attributes.
+ * @module anim
+ * @submodule anim-color
+ */
+
+var NUM = Number;
+
+Y.Anim.behaviors.color = {
+ set: function(anim, att, from, to, elapsed, duration, fn) {
+ from = Y.Color.re_RGB.exec(Y.Color.toRGB(from));
+ to = Y.Color.re_RGB.exec(Y.Color.toRGB(to));
+
+ if (!from || from.length < 3 || !to || to.length < 3) {
+ Y.error('invalid from or to passed to color behavior');
+ }
+
+ anim._node.setStyle(att, 'rgb(' + [
+ Math.floor(fn(elapsed, NUM(from[1]), NUM(to[1]) - NUM(from[1]), duration)),
+ Math.floor(fn(elapsed, NUM(from[2]), NUM(to[2]) - NUM(from[2]), duration)),
+ Math.floor(fn(elapsed, NUM(from[3]), NUM(to[3]) - NUM(from[3]), duration))
+ ].join(', ') + ')');
+ },
+
+ // TODO: default bgcolor const
+ get: function(anim, att) {
+ var val = anim._node.getComputedStyle(att);
+ val = (val === 'transparent') ? 'rgb(255, 255, 255)' : val;
+ return val;
+ }
+};
+
+Y.each(['backgroundColor',
+ 'borderColor',
+ 'borderTopColor',
+ 'borderRightColor',
+ 'borderBottomColor',
+ 'borderLeftColor'],
+ function(v, i) {
+ Y.Anim.behaviors[v] = Y.Anim.behaviors.color;
+ }
+);
+
+
+}, '@VERSION@' ,{requires:['anim-base']});
View
57 build/anim-curve/anim-curve-debug.js
@@ -0,0 +1,57 @@
+YUI.add('anim-curve', function(Y) {
+
+/**
+ * Adds support for the <code>curve</code> property for the <code>to</code>
+ * attribute. A curve is zero or more control points and an end point.
+ * @module anim
+ * @submodule anim-curve
+ */
+
+Y.Anim.behaviors.curve = {
+ set: function(anim, att, from, to, elapsed, duration, fn) {
+ from = from.slice.call(from);
+ to = to.slice.call(to);
+ var t = fn(elapsed, 0, 100, duration) / 100;
+ to.unshift(from);
+ anim._node.setXY(Y.Anim.getBezier(to, t));
+ },
+
+ get: function(anim, att) {
+ return anim._node.getXY();
+ }
+};
+
+/**
+ * Get the current position of the animated element based on t.
+ * Each point is an array of "x" and "y" values (0 = x, 1 = y)
+ * At least 2 points are required (start and end).
+ * First point is start. Last point is end.
+ * Additional control points are optional.
+ * @for Anim
+ * @method getBezier
+ * @static
+ * @param {Array} points An array containing Bezier points
+ * @param {Number} t A number between 0 and 1 which is the basis for determining current position
+ * @return {Array} An array containing int x and y member data
+ */
+Y.Anim.getBezier = function(points, t) {
+ var n = points.length;
+ var tmp = [];
+
+ for (var i = 0; i < n; ++i){
+ tmp[i] = [points[i][0], points[i][1]]; // save input
+ }
+
+ for (var j = 1; j < n; ++j) {
+ for (i = 0; i < n - j; ++i) {
+ tmp[i][0] = (1 - t) * tmp[i][0] + t * tmp[parseInt(i + 1, 10)][0];
+ tmp[i][1] = (1 - t) * tmp[i][1] + t * tmp[parseInt(i + 1, 10)][1];
+ }
+ }
+
+ return [ tmp[0][0], tmp[0][1] ];
+
+};
+
+
+}, '@VERSION@' ,{requires:['anim-xy']});
View
1 build/anim-curve/anim-curve-min.js
@@ -0,0 +1 @@
+YUI.add("anim-curve",function(a){a.Anim.behaviors.curve={set:function(f,c,i,h,b,g,e){i=i.slice.call(i);h=h.slice.call(h);var d=e(b,0,100,g)/100;h.unshift(i);f._node.setXY(a.Anim.getBezier(h,d));},get:function(c,b){return c._node.getXY();}};a.Anim.getBezier=function(f,e){var g=f.length;var d=[];for(var c=0;c<g;++c){d[c]=[f[c][0],f[c][1]];}for(var b=1;b<g;++b){for(c=0;c<g-b;++c){d[c][0]=(1-e)*d[c][0]+e*d[parseInt(c+1,10)][0];d[c][1]=(1-e)*d[c][1]+e*d[parseInt(c+1,10)][1];}}return[d[0][0],d[0][1]];};},"@VERSION@",{requires:["anim-xy"]});
View
57 build/anim-curve/anim-curve.js
@@ -0,0 +1,57 @@
+YUI.add('anim-curve', function(Y) {
+
+/**
+ * Adds support for the <code>curve</code> property for the <code>to</code>
+ * attribute. A curve is zero or more control points and an end point.
+ * @module anim
+ * @submodule anim-curve
+ */
+
+Y.Anim.behaviors.curve = {
+ set: function(anim, att, from, to, elapsed, duration, fn) {
+ from = from.slice.call(from);
+ to = to.slice.call(to);
+ var t = fn(elapsed, 0, 100, duration) / 100;
+ to.unshift(from);
+ anim._node.setXY(Y.Anim.getBezier(to, t));
+ },
+
+ get: function(anim, att) {
+ return anim._node.getXY();
+ }
+};
+
+/**
+ * Get the current position of the animated element based on t.
+ * Each point is an array of "x" and "y" values (0 = x, 1 = y)
+ * At least 2 points are required (start and end).
+ * First point is start. Last point is end.
+ * Additional control points are optional.
+ * @for Anim
+ * @method getBezier
+ * @static
+ * @param {Array} points An array containing Bezier points
+ * @param {Number} t A number between 0 and 1 which is the basis for determining current position
+ * @return {Array} An array containing int x and y member data
+ */
+Y.Anim.getBezier = function(points, t) {
+ var n = points.length;
+ var tmp = [];
+
+ for (var i = 0; i < n; ++i){
+ tmp[i] = [points[i][0], points[i][1]]; // save input
+ }
+
+ for (var j = 1; j < n; ++j) {
+ for (i = 0; i < n - j; ++i) {
+ tmp[i][0] = (1 - t) * tmp[i][0] + t * tmp[parseInt(i + 1, 10)][0];
+ tmp[i][1] = (1 - t) * tmp[i][1] + t * tmp[parseInt(i + 1, 10)][1];
+ }
+ }
+
+ return [ tmp[0][0], tmp[0][1] ];
+
+};
+
+
+}, '@VERSION@' ,{requires:['anim-xy']});
View
350 build/anim-easing/anim-easing-debug.js
@@ -0,0 +1,350 @@
+YUI.add('anim-easing', function(Y) {
+
+/*
+TERMS OF USE - EASING EQUATIONS
+Open source under the BSD License.
+Copyright 2001 Robert Penner All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+ * Neither the name of the author nor the names of contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+/**
+ * The easing module provides methods for customizing
+ * how an animation behaves during each run.
+ * @class Easing
+ * @module anim
+ * @submodule anim-easing
+ */
+
+var Easing = {
+
+ /**
+ * Uniform speed between points.
+ * @for Easing
+ * @method easeNone
+ * @param {Number} t Time value used to compute current value
+ * @param {Number} b Starting value
+ * @param {Number} c Delta between start and end values
+ * @param {Number} d Total length of animation
+ * @return {Number} The computed value for the current animation frame
+ */
+ easeNone: function (t, b, c, d) {
+ return c*t/d + b;
+ },
+
+ /**
+ * Begins slowly and accelerates towards end. (quadratic)
+ * @method easeIn
+ * @param {Number} t Time value used to compute current value
+ * @param {Number} b Starting value
+ * @param {Number} c Delta between start and end values
+ * @param {Number} d Total length of animation
+ * @return {Number} The computed value for the current animation frame
+ */
+ easeIn: function (t, b, c, d) {
+ return c*(t/=d)*t + b;
+ },
+
+ /**
+ * Begins quickly and decelerates towards end. (quadratic)
+ * @method easeOut
+ * @param {Number} t Time value used to compute current value
+ * @param {Number} b Starting value
+ * @param {Number} c Delta between start and end values
+ * @param {Number} d Total length of animation
+ * @return {Number} The computed value for the current animation frame
+ */
+ easeOut: function (t, b, c, d) {
+ return -c *(t/=d)*(t-2) + b;
+ },
+
+ /**
+ * Begins slowly and decelerates towards end. (quadratic)
+ * @method easeBoth
+ * @param {Number} t Time value used to compute current value
+ * @param {Number} b Starting value
+ * @param {Number} c Delta between start and end values
+ * @param {Number} d Total length of animation
+ * @return {Number} The computed value for the current animation frame
+ */
+ easeBoth: function (t, b, c, d) {
+ if ((t/=d/2) < 1) {
+ return c/2*t*t + b;
+ }
+
+ return -c/2 * ((--t)*(t-2) - 1) + b;
+ },
+
+ /**
+ * Begins slowly and accelerates towards end. (quartic)
+ * @method easeInStrong
+ * @param {Number} t Time value used to compute current value
+ * @param {Number} b Starting value
+ * @param {Number} c Delta between start and end values
+ * @param {Number} d Total length of animation
+ * @return {Number} The computed value for the current animation frame
+ */
+ easeInStrong: function (t, b, c, d) {
+ return c*(t/=d)*t*t*t + b;
+ },
+
+ /**
+ * Begins quickly and decelerates towards end. (quartic)
+ * @method easeOutStrong
+ * @param {Number} t Time value used to compute current value
+ * @param {Number} b Starting value
+ * @param {Number} c Delta between start and end values
+ * @param {Number} d Total length of animation
+ * @return {Number} The computed value for the current animation frame
+ */
+ easeOutStrong: function (t, b, c, d) {
+ return -c * ((t=t/d-1)*t*t*t - 1) + b;
+ },
+
+ /**
+ * Begins slowly and decelerates towards end. (quartic)
+ * @method easeBothStrong
+ * @param {Number} t Time value used to compute current value
+ * @param {Number} b Starting value
+ * @param {Number} c Delta between start and end values
+ * @param {Number} d Total length of animation
+ * @return {Number} The computed value for the current animation frame
+ */
+ easeBothStrong: function (t, b, c, d) {
+ if ((t/=d/2) < 1) {
+ return c/2*t*t*t*t + b;
+ }
+
+ return -c/2 * ((t-=2)*t*t*t - 2) + b;
+ },
+
+ /**
+ * Snap in elastic effect.
+ * @method elasticIn
+ * @param {Number} t Time value used to compute current value
+ * @param {Number} b Starting value
+ * @param {Number} c Delta between start and end values
+ * @param {Number} d Total length of animation
+ * @param {Number} a Amplitude (optional)
+ * @param {Number} p Period (optional)
+ * @return {Number} The computed value for the current animation frame
+ */
+
+ elasticIn: function (t, b,