Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'master' into base-events

Conflicts:
	src/base/base-base.properties
	src/base/build.xml
	src/base/tests/base-tests.js
  • Loading branch information...
commit 547702fb7dd81a15e111dcea627490be5fd84aae 2 parents d92409c + cb75c74
@ericf authored
Showing with 16,422 additions and 669 deletions.
  1. +1 −68 .gitignore
  2. +3 −2 .travis.yml
  3. +31 −7 README.md
  4. +294 −0 build/align-plugin/align-plugin-coverage.js
  5. +2 −2 build/align-plugin/align-plugin-debug.js
  6. +1 −1  build/align-plugin/align-plugin-min.js
  7. +2 −2 build/align-plugin/align-plugin.js
  8. +926 −0 build/anim-base/anim-base-coverage.js
  9. +3 −3 build/anim-base/anim-base-debug.js
  10. +1 −1  build/anim-base/anim-base-min.js
  11. +3 −3 build/anim-base/anim-base.js
  12. +106 −0 build/anim-color/anim-color-coverage.js
  13. +19 −14 build/anim-color/anim-color-debug.js
  14. +1 −1  build/anim-color/anim-color-min.js
  15. +19 −14 build/anim-color/anim-color.js
  16. +112 −0 build/anim-curve/anim-curve-coverage.js
  17. +2 −2 build/anim-curve/anim-curve-debug.js
  18. +1 −1  build/anim-curve/anim-curve-min.js
  19. +2 −2 build/anim-curve/anim-curve.js
  20. +476 −0 build/anim-easing/anim-easing-coverage.js
  21. +2 −2 build/anim-easing/anim-easing-debug.js
  22. +1 −1  build/anim-easing/anim-easing-min.js
  23. +2 −2 build/anim-easing/anim-easing.js
  24. +71 −0 build/anim-node-plugin/anim-node-plugin-coverage.js
  25. +3 −3 build/anim-node-plugin/anim-node-plugin-debug.js
  26. +1 −1  build/anim-node-plugin/anim-node-plugin-min.js
  27. +3 −3 build/anim-node-plugin/anim-node-plugin.js
  28. +84 −0 build/anim-scroll/anim-scroll-coverage.js
  29. +2 −2 build/anim-scroll/anim-scroll-debug.js
  30. +1 −1  build/anim-scroll/anim-scroll-min.js
  31. +2 −2 build/anim-scroll/anim-scroll.js
  32. +186 −0 build/anim-shape-transform/anim-shape-transform-coverage.js
  33. +0 −106 build/anim-shape-transform/anim-shape-transform-debug.js
  34. +0 −1  build/anim-shape-transform/anim-shape-transform-min.js
  35. +0 −106 build/anim-shape-transform/anim-shape-transform.js
  36. +296 −0 build/anim-shape/anim-shape-coverage.js
  37. +189 −0 build/anim-shape/anim-shape-debug.js
  38. +1 −0  build/anim-shape/anim-shape-min.js
  39. +189 −0 build/anim-shape/anim-shape.js
  40. +67 −0 build/anim-xy/anim-xy-coverage.js
  41. +2 −2 build/anim-xy/anim-xy-debug.js
  42. +1 −1  build/anim-xy/anim-xy-min.js
  43. +2 −2 build/anim-xy/anim-xy.js
  44. +1,274 −0 build/app-base/app-base-coverage.js
  45. +39 −19 build/app-base/app-base-debug.js
  46. +1 −1  build/app-base/app-base-min.js
  47. +39 −19 build/app-base/app-base.js
  48. +308 −0 build/app-content/app-content-coverage.js
  49. +233 −0 build/app-content/app-content-debug.js
  50. +1 −0  build/app-content/app-content-min.js
  51. +233 −0 build/app-content/app-content.js
  52. +1 −1  build/app-transitions-css/app-transitions-css-min.css
  53. +1 −0  build/app-transitions-css/app-transitions-css.css
  54. +480 −0 build/app-transitions-native/app-transitions-native-coverage.js
  55. +3 −2 build/app-transitions-native/app-transitions-native-debug.js
  56. +1 −1  build/app-transitions-native/app-transitions-native-min.js
  57. +3 −2 build/app-transitions-native/app-transitions-native.js
  58. +289 −0 build/app-transitions/app-transitions-coverage.js
  59. +13 −11 build/app-transitions/app-transitions-debug.js
  60. +1 −1  build/app-transitions/app-transitions-min.js
  61. +13 −11 build/app-transitions/app-transitions.js
  62. +543 −0 build/array-extras/array-extras-coverage.js
  63. +36 −3 build/array-extras/array-extras-debug.js
  64. +1 −1  build/array-extras/array-extras-min.js
  65. +36 −3 build/array-extras/array-extras.js
  66. +83 −0 build/array-invoke/array-invoke-coverage.js
  67. +2 −2 build/array-invoke/array-invoke-debug.js
  68. +1 −1  build/array-invoke/array-invoke-min.js
  69. +2 −2 build/array-invoke/array-invoke.js
  70. +139 −0 build/arraylist-add/arraylist-add-coverage.js
  71. +2 −2 build/arraylist-add/arraylist-add-debug.js
  72. +1 −1  build/arraylist-add/arraylist-add-min.js
  73. +2 −2 build/arraylist-add/arraylist-add.js
  74. +89 −0 build/arraylist-filter/arraylist-filter-coverage.js
  75. +2 −2 build/arraylist-filter/arraylist-filter-debug.js
  76. +1 −1  build/arraylist-filter/arraylist-filter-min.js
  77. +2 −2 build/arraylist-filter/arraylist-filter.js
  78. +295 −0 build/arraylist/arraylist-coverage.js
  79. +2 −2 build/arraylist/arraylist-debug.js
  80. +1 −1  build/arraylist/arraylist-min.js
  81. +2 −2 build/arraylist/arraylist.js
  82. +118 −0 build/arraysort/arraysort-coverage.js
  83. +2 −2 build/arraysort/arraysort-debug.js
  84. +1 −1  build/arraysort/arraysort-min.js
  85. +2 −2 build/arraysort/arraysort.js
  86. +679 −0 build/async-queue/async-queue-coverage.js
  87. +2 −2 build/async-queue/async-queue-debug.js
  88. +1 −1  build/async-queue/async-queue-min.js
  89. +2 −2 build/async-queue/async-queue.js
  90. +152 −0 build/attribute-base/attribute-base-coverage.js
  91. +2 −3 build/attribute-base/attribute-base-debug.js
  92. +1 −1  build/attribute-base/attribute-base-min.js
  93. +2 −3 build/attribute-base/attribute-base.js
  94. +208 −0 build/attribute-complex/attribute-complex-coverage.js
  95. +2 −2 build/attribute-complex/attribute-complex-debug.js
  96. +1 −1  build/attribute-complex/attribute-complex-min.js
  97. +2 −2 build/attribute-complex/attribute-complex.js
  98. +1,303 −0 build/attribute-core/attribute-core-coverage.js
  99. +70 −54 build/attribute-core/attribute-core-debug.js
  100. +1 −1  build/attribute-core/attribute-core-min.js
  101. +70 −54 build/attribute-core/attribute-core.js
  102. +269 −0 build/attribute-events/attribute-events-coverage.js
  103. +4 −3 build/attribute-events/attribute-events-debug.js
  104. +1 −1  build/attribute-events/attribute-events-min.js
  105. +4 −3 build/attribute-events/attribute-events.js
  106. +214 −0 build/attribute-extras/attribute-extras-coverage.js
  107. +2 −2 build/attribute-extras/attribute-extras-debug.js
  108. +1 −1  build/attribute-extras/attribute-extras-min.js
  109. +2 −2 build/attribute-extras/attribute-extras.js
  110. +1,812 −0 build/autocomplete-base/autocomplete-base-coverage.js
  111. +2 −2 build/autocomplete-base/autocomplete-base-debug.js
  112. +1 −2  build/autocomplete-base/autocomplete-base-min.js
  113. +2 −2 build/autocomplete-base/autocomplete-base.js
  114. +212 −0 build/autocomplete-filters-accentfold/autocomplete-filters-accentfold-coverage.js
  115. +2 −2 build/autocomplete-filters-accentfold/autocomplete-filters-accentfold-debug.js
  116. +1 −1  build/autocomplete-filters-accentfold/autocomplete-filters-accentfold-min.js
  117. +2 −2 build/autocomplete-filters-accentfold/autocomplete-filters-accentfold.js
  118. +328 −0 build/autocomplete-filters/autocomplete-filters-coverage.js
  119. +2 −2 build/autocomplete-filters/autocomplete-filters-debug.js
  120. +1 −1  build/autocomplete-filters/autocomplete-filters-min.js
  121. +2 −2 build/autocomplete-filters/autocomplete-filters.js
  122. +166 −0 build/autocomplete-highlighters-accentfold/autocomplete-highlighters-accentfold-coverage.js
  123. +2 −2 build/autocomplete-highlighters-accentfold/autocomplete-highlighters-accentfold-debug.js
  124. +1 −1  build/autocomplete-highlighters-accentfold/autocomplete-highlighters-accentfold-min.js
  125. +2 −2 build/autocomplete-highlighters-accentfold/autocomplete-highlighters-accentfold.js
  126. +267 −0 build/autocomplete-highlighters/autocomplete-highlighters-coverage.js
  127. +2 −2 build/autocomplete-highlighters/autocomplete-highlighters-debug.js
  128. +1 −1  build/autocomplete-highlighters/autocomplete-highlighters-min.js
  129. +2 −2 build/autocomplete-highlighters/autocomplete-highlighters.js
  130. +275 −0 build/autocomplete-list-keys/autocomplete-list-keys-coverage.js
  131. +2 −2 build/autocomplete-list-keys/autocomplete-list-keys-debug.js
  132. +1 −1  build/autocomplete-list-keys/autocomplete-list-keys-min.js
  133. +2 −2 build/autocomplete-list-keys/autocomplete-list-keys.js
  134. +1,125 −0 build/autocomplete-list/autocomplete-list-coverage.js
  135. +9 −5 build/autocomplete-list/autocomplete-list-debug.js
  136. +1 −2  build/autocomplete-list/autocomplete-list-min.js
  137. +9 −5 build/autocomplete-list/autocomplete-list.js
  138. +1 −1  build/autocomplete-list/lang/autocomplete-list.js
  139. +1 −1  build/autocomplete-list/lang/autocomplete-list_en.js
  140. +93 −0 build/autocomplete-plugin/autocomplete-plugin-coverage.js
  141. +2 −2 build/autocomplete-plugin/autocomplete-plugin-debug.js
  142. +1 −1  build/autocomplete-plugin/autocomplete-plugin-min.js
  143. +2 −2 build/autocomplete-plugin/autocomplete-plugin.js
  144. +642 −0 build/autocomplete-sources/autocomplete-sources-coverage.js
  145. +3 −4 build/autocomplete-sources/autocomplete-sources-debug.js
  146. +1 −1  build/autocomplete-sources/autocomplete-sources-min.js
  147. +3 −4 build/autocomplete-sources/autocomplete-sources.js
  148. +431 −0 build/base-base/base-base-coverage.js
  149. +2 −2 build/base-base/base-base-debug.js
  150. +1 −1  build/base-base/base-base-min.js
  151. +2 −2 build/base-base/base-base.js
  152. +591 −0 build/base-build/base-build-coverage.js
  153. +4 −4 build/base-build/base-build-debug.js
  154. +1 −1  build/base-build/base-build-min.js
  155. +4 −4 build/base-build/base-build.js
Sorry, we could not display the entire diff because too many files (4,430) changed.
View
69 .gitignore
@@ -14,71 +14,4 @@ src/build.log
src/out
node_modules
api-js/
-build/autocomplete-base/assets/autocomplete-list-core.css
-build/autocomplete-filters-accentfold/assets/autocomplete-list-core.css
-build/autocomplete-filters/assets/autocomplete-list-core.css
-build/autocomplete-highlighters-accentfold/assets/autocomplete-list-core.css
-build/autocomplete-highlighters/assets/autocomplete-list-core.css
-build/autocomplete-list-keys/assets/autocomplete-list-core.css
-build/autocomplete-plugin/assets/autocomplete-list-core.css
-build/autocomplete-sources/assets/autocomplete-list-core.css
-build/datatable-body/assets/
-build/datatable-core/assets/
-build/datatable-head/assets/
-build/datatable-table/assets/
-build/datatable-column-widths/assets/
-build/datatable-mutable/assets/
-build/datatable-datasource/assets/
-build/datatable-base/assets/datatable-scroll-core.css
-build/datatable-base/assets/datatable-sort-core.css
-build/datatable-base/assets/skins/night/datatable-scroll-skin.css
-build/datatable-base/assets/skins/night/datatable-sort-skin.css
-build/datatable-base/assets/skins/sam/datatable-scroll-skin.css
-build/datatable-base/assets/skins/sam/datatable-sort-skin.css
-build/datatable-base/assets/datatable-message-core.css
-build/datatable-base/assets/skins/night/datatable-message-skin.css
-build/datatable-base/assets/skins/sam/datatable-message-skin.css
-build/datatable-base/assets/skins/sam/*.png
-build/datatable-base/assets/skins/night/*.png
-build/datatable-base/assets/skins/night/sort-arrow-sprite-ie.png
-build/datatable-scroll/assets/skins/sam/datatable-message.css
-build/datatable-scroll/assets/skins/night/datatable-message.css
-build/datatable-scroll/assets/skins/sam/datatable-message-skin.css
-build/datatable-scroll/assets/skins/night/datatable-message-skin.css
-build/datatable-scroll/assets/datatable-base-core.css
-build/datatable-scroll/assets/datatable-sort-core.css
-build/datatable-scroll/assets/skins/night/datatable-base-skin.css
-build/datatable-scroll/assets/skins/night/datatable-sort-skin.css
-build/datatable-scroll/assets/skins/sam/datatable-base-skin.css
-build/datatable-scroll/assets/skins/sam/datatable-sort-skin.css
-build/datatable-scroll/assets/skins/sam/*.png
-build/datatable-scroll/assets/skins/night/*.png
-build/datatable-scroll/assets/datatable-message-core.css
-build/datatable-scroll/assets/skins/sam/datatable-message.css
-build/datatable-scroll/assets/skins/night/datatable-message.css
-build/datatable-scroll/assets/skins/sam/datatable-message-skin.css
-build/datatable-scroll/assets/skins/night/datatable-message-skin.css
-build/datatable-sort/assets/datatable-base-core.css
-build/datatable-sort/assets/datatable-scroll-core.css
-build/datatable-sort/assets/skins/night/datatable-base-skin.css
-build/datatable-sort/assets/skins/night/datatable-scroll-skin.css
-build/datatable-sort/assets/skins/sam/datatable-base-skin.css
-build/datatable-sort/assets/skins/sam/datatable-scroll-skin.css
-build/datatable-sort/assets/datatable-message-core.css
-build/datatable-sort/assets/skins/night/datatable-message-skin.css
-build/datatable-sort/assets/skins/sam/datatable-message-skin.css
-build/datatable-message/assets/datatable-base-core.css
-build/datatable-message/assets/datatable-scroll-core.css
-build/datatable-message/assets/datatable-sort-core.css
-build/datatable-message/assets/skins/night/datatable-base-skin.css
-build/datatable-message/assets/skins/night/datatable-scroll-skin.css
-build/datatable-message/assets/skins/night/datatable-sort-skin.css
-build/datatable-message/assets/skins/sam/datatable-base-skin.css
-build/datatable-message/assets/skins/sam/datatable-scroll-skin.css
-build/datatable-message/assets/skins/sam/datatable-sort-skin.css
-build/datatable-message/assets/skins/sam/*.png
-build/datatable-message/assets/skins/night/*.png
-build/datatable-base-deprecated/assets/datatable-base-core.css
-build/datatable-datasource-deprecated/assets/
-build/datatable-scroll-deprecated/assets/
-build/datatable-sort-deprecated/assets/
+.yeti.json
View
5 .travis.yml
@@ -1,11 +1,12 @@
language: node_js
node_js:
- - 0.4
- 0.6
- - 0.7
+ - 0.8
+ - 0.9
branches:
only:
- master
+ - 3.x
before_install:
- ./src/common/travis/before.sh
install:
View
38 README.md
@@ -16,19 +16,43 @@ Links
* [Contributor Info](http://yuilibrary.com/contribute/)
* [Report a Bug](http://yuilibrary.com/yui/docs/tutorials/report-bugs/)
* [![Build Status](https://secure.travis-ci.org/yui/yui3.png?branch=master)](http://travis-ci.org/yui/yui3)
+ * [Shifter, for building YUI](http://yui.github.com/shifter/)
Source Info
-----------
This is the active working source tree for YUI 3. It contains work in progress
-toward the next YUI 3 release and may be unstable.
+toward the next YUI 3 releases and may be unstable.
We encourage you to use the latest source for evaluation purposes, testing new
features and bug fixes, and to provide feedback on new functionality. Please
refer to the "Latest Production Release" link above if you're looking for the
latest stable release of YUI recommended for production use.
+### Branches
+
+YUI's development happens on three main branches. The following describes what
+each of these code branches represents:
+
+ * `live-docs`: Represents the latest release of YUI, plus any
+ documentation-only updates. Any tweaks or additions to the docs for the
+ latest release happen on this branch, and they are reflected on the website.
+
+ * `master`: Contains everything in `live-docs`, plus code changes that will go
+ into the next YUI release. The code changes in `master` are either bug fixes
+ or small changes which should not break API compatibility. Patch releases
+ will be cut from this branch; e.g. 3.6.x.
+
+ * `3.x`: Represents the next major YUI release; e.g. 3.7.0. This is an
+ integration branch which contains everything in `master`, plus larger code
+ changes which will go into a future YUI release. The changes in `3.x`
+ require a minor version increment before they are part of release; e.g.
+ 3.7.0. Preview Releases will be cut from this branch for developers to test
+ and evaluate.
+
+### Source Tree
+
The YUI source tree includes the following directories:
* `build`: Built YUI source files. The built files are generated at
@@ -43,10 +67,10 @@ The YUI source tree includes the following directories:
modifications to the library and its documentation should take place in
this directory.
-The individual component directories under the `src` directory contain Ant
-build files (`build.xml` and others) which can be used to build individual
-modules using the YUI Builder. The YUI Builder is part of the "builder" project,
-also available on GitHub at <https://github.com/yui/builder>
+To build YUI components install [Shifter](http://yui.github.com/shifter/) (`npm -g install shifter`)
+and then simply run `shifter` in that components directory.
+
+Shifter also allows you to rebuild the entire YUI src tree:
+
+ cd yui3/src && shifter --walk
-The `README` file in the `componentbuild` directory of the Builder project
-covers the installation and use of the build tool.
View
294 build/align-plugin/align-plugin-coverage.js
@@ -0,0 +1,294 @@
+if (typeof _yuitest_coverage == "undefined"){
+ _yuitest_coverage = {};
+ _yuitest_coverline = function(src, line){
+ var coverage = _yuitest_coverage[src];
+ if (!coverage.lines[line]){
+ coverage.calledLines++;
+ }
+ coverage.lines[line]++;
+ };
+ _yuitest_coverfunc = function(src, name, line){
+ var coverage = _yuitest_coverage[src],
+ funcId = name + ":" + line;
+ if (!coverage.functions[funcId]){
+ coverage.calledFunctions++;
+ }
+ coverage.functions[funcId]++;
+ };
+}
+_yuitest_coverage["build/align-plugin/align-plugin.js"] = {
+ lines: {},
+ functions: {},
+ coveredLines: 0,
+ calledLines: 0,
+ coveredFunctions: 0,
+ calledFunctions: 0,
+ path: "build/align-plugin/align-plugin.js",
+ code: []
+};
+_yuitest_coverage["build/align-plugin/align-plugin.js"].code=["YUI.add('align-plugin', function (Y, NAME) {",""," /**"," * 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 "," * @param region {String || Node || HTMLElement || Object} The node or"," * region to align with. Defaults to the viewport region."," * @param regionPoint {String} The point of the region to align with."," * @param point {String} The point of the node aligned to the region. "," * @param 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 "," * @param 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-screen\", \"node-pluginhost\"]});"];
+_yuitest_coverage["build/align-plugin/align-plugin.js"].lines = {"1":0,"9":0,"20":0,"21":0,"22":0,"26":0,"60":0,"62":0,"63":0,"66":0,"67":0,"79":0,"80":0,"82":0,"83":0,"86":0,"87":0,"89":0,"90":0,"93":0,"94":0,"97":0,"100":0,"104":0,"105":0,"109":0,"110":0,"111":0,"112":0,"113":0,"119":0,"120":0,"121":0,"134":0,"135":0,"144":0,"145":0,"146":0,"151":0,"153":0,"157":0,"161":0,"165":0,"169":0,"172":0,"173":0,"175":0,"176":0,"179":0,"183":0,"184":0,"186":0,"188":0,"189":0};
+_yuitest_coverage["build/align-plugin/align-plugin.js"].functions = {"Align:20":0,"to:58":0,"sync:103":0,"_resize:108":0,"(anonymous 2):120":0,"_onresize:118":0,"center:133":0,"destroy:143":0,"\'t\':152":0,"\'r\':156":0,"\'b\':160":0,"\'l\':164":0,"\'c\':168":0,"(anonymous 1):1":0};
+_yuitest_coverage["build/align-plugin/align-plugin.js"].coveredLines = 54;
+_yuitest_coverage["build/align-plugin/align-plugin.js"].coveredFunctions = 14;
+_yuitest_coverline("build/align-plugin/align-plugin.js", 1);
+YUI.add('align-plugin', function (Y, NAME) {
+
+ /**
+ * Provides advanced positioning support for Node via a Plugin
+ * for centering and alignment.
+ * @module align-plugin
+ */
+
+ _yuitest_coverfunc("build/align-plugin/align-plugin.js", "(anonymous 1)", 1);
+_yuitest_coverline("build/align-plugin/align-plugin.js", 9);
+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
+ */
+ _yuitest_coverline("build/align-plugin/align-plugin.js", 20);
+function Align(config) {
+ _yuitest_coverfunc("build/align-plugin/align-plugin.js", "Align", 20);
+_yuitest_coverline("build/align-plugin/align-plugin.js", 21);
+if (config.host) {
+ _yuitest_coverline("build/align-plugin/align-plugin.js", 22);
+this._host = config.host;
+ }
+ }
+
+ _yuitest_coverline("build/align-plugin/align-plugin.js", 26);
+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
+ * @param region {String || Node || HTMLElement || Object} The node or
+ * region to align with. Defaults to the viewport region.
+ * @param regionPoint {String} The point of the region to align with.
+ * @param point {String} The point of the node aligned to the region.
+ * @param 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
+ _yuitest_coverfunc("build/align-plugin/align-plugin.js", "to", 58);
+_yuitest_coverline("build/align-plugin/align-plugin.js", 60);
+this._syncArgs = Y.Array(arguments);
+
+ _yuitest_coverline("build/align-plugin/align-plugin.js", 62);
+if (region.top === undefined) {
+ _yuitest_coverline("build/align-plugin/align-plugin.js", 63);
+region = Y.one(region).get('region');
+ }
+
+ _yuitest_coverline("build/align-plugin/align-plugin.js", 66);
+if (region) {
+ _yuitest_coverline("build/align-plugin/align-plugin.js", 67);
+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;
+
+ _yuitest_coverline("build/align-plugin/align-plugin.js", 79);
+if (regionFn0) {
+ _yuitest_coverline("build/align-plugin/align-plugin.js", 80);
+xy = regionFn0(xy, offxy, regionPoint);
+ }
+ _yuitest_coverline("build/align-plugin/align-plugin.js", 82);
+if (regionFn1) {
+ _yuitest_coverline("build/align-plugin/align-plugin.js", 83);
+xy = regionFn1(xy, offxy, regionPoint);
+ }
+
+ _yuitest_coverline("build/align-plugin/align-plugin.js", 86);
+if (nodeFn0) {
+ _yuitest_coverline("build/align-plugin/align-plugin.js", 87);
+xy = nodeFn0(xy, nodeoff, point);
+ }
+ _yuitest_coverline("build/align-plugin/align-plugin.js", 89);
+if (nodeFn1) {
+ _yuitest_coverline("build/align-plugin/align-plugin.js", 90);
+xy = nodeFn1(xy, nodeoff, point);
+ }
+
+ _yuitest_coverline("build/align-plugin/align-plugin.js", 93);
+if (xy && node) {
+ _yuitest_coverline("build/align-plugin/align-plugin.js", 94);
+node.setXY(xy);
+ }
+
+ _yuitest_coverline("build/align-plugin/align-plugin.js", 97);
+this._resize(syncOnResize);
+
+ }
+ _yuitest_coverline("build/align-plugin/align-plugin.js", 100);
+return this;
+ },
+
+ sync: function() {
+ _yuitest_coverfunc("build/align-plugin/align-plugin.js", "sync", 103);
+_yuitest_coverline("build/align-plugin/align-plugin.js", 104);
+this.to.apply(this, this._syncArgs);
+ _yuitest_coverline("build/align-plugin/align-plugin.js", 105);
+return this;
+ },
+
+ _resize: function(add) {
+ _yuitest_coverfunc("build/align-plugin/align-plugin.js", "_resize", 108);
+_yuitest_coverline("build/align-plugin/align-plugin.js", 109);
+var handle = this._handle;
+ _yuitest_coverline("build/align-plugin/align-plugin.js", 110);
+if (add && !handle) {
+ _yuitest_coverline("build/align-plugin/align-plugin.js", 111);
+this._handle = Y.on('resize', this._onresize, window, this);
+ } else {_yuitest_coverline("build/align-plugin/align-plugin.js", 112);
+if (!add && handle) {
+ _yuitest_coverline("build/align-plugin/align-plugin.js", 113);
+handle.detach();
+ }}
+
+ },
+
+ _onresize: function() {
+ _yuitest_coverfunc("build/align-plugin/align-plugin.js", "_onresize", 118);
+_yuitest_coverline("build/align-plugin/align-plugin.js", 119);
+var self = this;
+ _yuitest_coverline("build/align-plugin/align-plugin.js", 120);
+setTimeout(function() { // for performance
+ _yuitest_coverfunc("build/align-plugin/align-plugin.js", "(anonymous 2)", 120);
+_yuitest_coverline("build/align-plugin/align-plugin.js", 121);
+self.sync();
+ });
+ },
+
+ /**
+ * Aligns the center of a node to the center of another node or region.
+ * @method center
+ * @param 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) {
+ _yuitest_coverfunc("build/align-plugin/align-plugin.js", "center", 133);
+_yuitest_coverline("build/align-plugin/align-plugin.js", 134);
+this.to(region, 'cc', 'cc', resize);
+ _yuitest_coverline("build/align-plugin/align-plugin.js", 135);
+return this;
+ },
+
+ /**
+ * Removes the resize handler, if any. This is called automatically
+ * when unplugged from the host node.
+ * @method destroy
+ */
+ destroy: function() {
+ _yuitest_coverfunc("build/align-plugin/align-plugin.js", "destroy", 143);
+_yuitest_coverline("build/align-plugin/align-plugin.js", 144);
+var handle = this._handle;
+ _yuitest_coverline("build/align-plugin/align-plugin.js", 145);
+if (handle) {
+ _yuitest_coverline("build/align-plugin/align-plugin.js", 146);
+handle.detach();
+ }
+ }
+ };
+
+ _yuitest_coverline("build/align-plugin/align-plugin.js", 151);
+Align.points = {
+ 't': function(xy, off) {
+ _yuitest_coverfunc("build/align-plugin/align-plugin.js", "\'t\'", 152);
+_yuitest_coverline("build/align-plugin/align-plugin.js", 153);
+return xy;
+ },
+
+ 'r': function(xy, off) {
+ _yuitest_coverfunc("build/align-plugin/align-plugin.js", "\'r\'", 156);
+_yuitest_coverline("build/align-plugin/align-plugin.js", 157);
+return [xy[0] + off[0], xy[1]];
+ },
+
+ 'b': function(xy, off) {
+ _yuitest_coverfunc("build/align-plugin/align-plugin.js", "\'b\'", 160);
+_yuitest_coverline("build/align-plugin/align-plugin.js", 161);
+return [xy[0], xy[1] + off[1]];
+ },
+
+ 'l': function(xy, off) {
+ _yuitest_coverfunc("build/align-plugin/align-plugin.js", "\'l\'", 164);
+_yuitest_coverline("build/align-plugin/align-plugin.js", 165);
+return xy;
+ },
+
+ 'c': function(xy, off, point) {
+ _yuitest_coverfunc("build/align-plugin/align-plugin.js", "\'c\'", 168);
+_yuitest_coverline("build/align-plugin/align-plugin.js", 169);
+var axis = (point[0] === 't' || point[0] === 'b') ? 0 : 1,
+ ret, val;
+
+ _yuitest_coverline("build/align-plugin/align-plugin.js", 172);
+if (point === 'cc') {
+ _yuitest_coverline("build/align-plugin/align-plugin.js", 173);
+ret = [xy[0] + off[0] / 2, xy[1] + off[1] / 2];
+ } else {
+ _yuitest_coverline("build/align-plugin/align-plugin.js", 175);
+val = xy[axis] + off[axis] / 2;
+ _yuitest_coverline("build/align-plugin/align-plugin.js", 176);
+ret = (axis) ? [xy[0], val] : [val, xy[1]];
+ }
+
+ _yuitest_coverline("build/align-plugin/align-plugin.js", 179);
+return ret;
+ }
+ };
+
+ _yuitest_coverline("build/align-plugin/align-plugin.js", 183);
+Align.NAME = 'Align';
+ _yuitest_coverline("build/align-plugin/align-plugin.js", 184);
+Align.NS = 'align';
+
+ _yuitest_coverline("build/align-plugin/align-plugin.js", 186);
+Align.prototype.constructor = Align;
+
+ _yuitest_coverline("build/align-plugin/align-plugin.js", 188);
+Y.namespace('Plugin');
+ _yuitest_coverline("build/align-plugin/align-plugin.js", 189);
+Y.Plugin.Align = Align;
+
+
+
+}, '@VERSION@', {"requires": ["node-screen", "node-pluginhost"]});
View
4 build/align-plugin/align-plugin-debug.js
@@ -1,4 +1,4 @@
-YUI.add('align-plugin', function(Y) {
+YUI.add('align-plugin', function (Y, NAME) {
/**
* Provides advanced positioning support for Node via a Plugin
@@ -190,4 +190,4 @@ YUI.add('align-plugin', function(Y) {
-}, '@VERSION@' ,{requires:['node-pluginhost', 'node-screen']});
+}, '@VERSION@', {"requires": ["node-screen", "node-pluginhost"]});
View
2  build/align-plugin/align-plugin-min.js
@@ -1 +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"]});
+YUI.add("align-plugin",function(e,t){function s(e){e.host&&(this._host=e.host)}var n="offsetWidth",r="offsetHeight",i=i;s.prototype={to:function(t,o,u,a){this._syncArgs=e.Array(arguments),t.top===i&&(t=e.one(t).get("region"));if(t){var f=[t.left,t.top],l=[t.width,t.height],c=s.points,h=this._host,p=null,d=h.getAttrs([r,n]),v=[0-d[n],0-d[r]],m=o?c[o.charAt(0)]:p,g=o&&o!=="cc"?c[o.charAt(1)]:p,y=u?c[u.charAt(0)]:p,b=u&&u!=="cc"?c[u.charAt(1)]:p;m&&(f=m(f,l,o)),g&&(f=g(f,l,o)),y&&(f=y(f,v,u)),b&&(f=b(f,v,u)),f&&h&&h.setXY(f),this._resize(a)}return this},sync:function(){return this.to.apply(this,this._syncArgs),this},_resize:function(t){var n=this._handle;t&&!n?this._handle=e.on("resize",this._onresize,window,this):!t&&n&&n.detach()},_onresize:function(){var e=this;setTimeout(function(){e.sync()})},center:function(e,t){return this.to(e,"cc","cc",t),this},destroy:function(){var e=this._handle;e&&e.detach()}},s.points={t:function(e,t){return e},r:function(e,t){return[e[0]+t[0],e[1]]},b:function(e,t){return[e[0],e[1]+t[1]]},l:function(e,t){return e},c:function(e,t,n){var r=n[0]==="t"||n[0]==="b"?0:1,i,s;return n==="cc"?i=[e[0]+t[0]/2,e[1]+t[1]/2]:(s=e[r]+t[r]/2,i=r?[e[0],s]:[s,e[1]]),i}},s.NAME="Align",s.NS="align",s.prototype.constructor=s,e.namespace("Plugin"),e.Plugin.Align=s},"@VERSION@",{requires:["node-screen","node-pluginhost"]});
View
4 build/align-plugin/align-plugin.js
@@ -1,4 +1,4 @@
-YUI.add('align-plugin', function(Y) {
+YUI.add('align-plugin', function (Y, NAME) {
/**
* Provides advanced positioning support for Node via a Plugin
@@ -190,4 +190,4 @@ YUI.add('align-plugin', function(Y) {
-}, '@VERSION@' ,{requires:['node-pluginhost', 'node-screen']});
+}, '@VERSION@', {"requires": ["node-screen", "node-pluginhost"]});
View
926 build/anim-base/anim-base-coverage.js
@@ -0,0 +1,926 @@
+if (typeof _yuitest_coverage == "undefined"){
+ _yuitest_coverage = {};
+ _yuitest_coverline = function(src, line){
+ var coverage = _yuitest_coverage[src];
+ if (!coverage.lines[line]){
+ coverage.calledLines++;
+ }
+ coverage.lines[line]++;
+ };
+ _yuitest_coverfunc = function(src, name, line){
+ var coverage = _yuitest_coverage[src],
+ funcId = name + ":" + line;
+ if (!coverage.functions[funcId]){
+ coverage.calledFunctions++;
+ }
+ coverage.functions[funcId]++;
+ };
+}
+_yuitest_coverage["build/anim-base/anim-base.js"] = {
+ lines: {},
+ functions: {},
+ coveredLines: 0,
+ calledLines: 0,
+ coveredFunctions: 0,
+ calledFunctions: 0,
+ path: "build/anim-base/anim-base.js",
+ code: []
+};
+_yuitest_coverage["build/anim-base/anim-base.js"].code=["YUI.add('anim-base', function (Y, NAME) {","","/**","* 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,"," domNode = node._node,"," val = fn(elapsed, NUM(from), NUM(to) - NUM(from), duration);",""," if (domNode) {"," if ('style' in domNode && (att in domNode.style || att in Y.DOM.CUSTOM_STYLES)) {"," unit = unit || '';"," node.setStyle(att, val + unit);"," } else if ('attributes' in domNode && att in domNode.attributes) {"," node.setAttribute(att, val);"," } else if (att in domNode) {"," domNode[att] = val;"," }"," } else if (node.set) {"," node.set(att, val);"," } else if (att in node) {"," node[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,"," domNode = node._node,"," val = '';",""," if (domNode) {"," if ('style' in domNode && (att in domNode.style || att in Y.DOM.CUSTOM_STYLES)) {"," val = node.getComputedStyle(att);"," } else if ('attributes' in domNode && att in domNode.attributes) {"," val = node.getAttribute(att);"," } else if (att in domNode) {"," val = domNode[att];"," }"," } else if (node.get) {"," val = node.get(att);"," } else if (att in node) {"," val = node[att];"," }",""," return val;"," };",""," Y.Anim.ATTRS = {"," /**"," * The object to be animated."," * @attribute node"," * @type Node"," */"," node: {"," setter: function(node) {"," if (node) {"," if (typeof node == 'string' || node.nodeType) {"," 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."," * 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)."," *"," * @attribute from"," * @type Object"," */"," from: {},",""," /**"," * The ending values for the animated properties."," *"," * Fields may be strings, numbers, or functions."," * 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)."," *"," * @attribute to"," * @type Object"," */"," 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: Y.Lang.isObject(begin) ? Y.clone(begin) : 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\"]});"];
+_yuitest_coverage["build/anim-base/anim-base.js"].lines = {"1":0,"23":0,"57":0,"60":0,"61":0,"62":0,"65":0,"67":0,"75":0,"83":0,"85":0,"86":0,"96":0,"104":0,"107":0,"112":0,"120":0,"121":0,"125":0,"126":0,"127":0,"128":0,"129":0,"130":0,"131":0,"132":0,"134":0,"135":0,"136":0,"137":0,"147":0,"148":0,"152":0,"153":0,"154":0,"155":0,"156":0,"157":0,"158":0,"160":0,"161":0,"162":0,"163":0,"166":0,"169":0,"177":0,"178":0,"179":0,"183":0,"184":0,"186":0,"209":0,"210":0,"282":0,"354":0,"355":0,"356":0,"357":0,"358":0,"368":0,"369":0,"370":0,"371":0,"375":0,"383":0,"384":0,"385":0,"386":0,"389":0,"392":0,"393":0,"394":0,"398":0,"399":0,"400":0,"409":0,"410":0,"411":0,"412":0,"413":0,"414":0,"418":0,"419":0,"423":0,"425":0,"432":0,"433":0,"434":0,"435":0,"437":0,"448":0,"449":0,"451":0,"461":0,"462":0,"464":0,"470":0,"471":0,"472":0,"473":0,"475":0,"476":0,"478":0,"482":0,"483":0,"484":0,"492":0,"496":0,"497":0,"498":0,"499":0,"507":0,"511":0,"512":0,"513":0,"516":0,"517":0,"518":0,"520":0,"521":0,"525":0,"532":0,"533":0,"534":0,"536":0,"537":0,"538":0,"543":0,"552":0,"553":0,"556":0,"557":0,"558":0,"561":0,"562":0,"563":0,"564":0,"567":0,"568":0,"570":0,"579":0,"582":0,"583":0,"584":0,"585":0,"593":0,"595":0,"596":0,"599":0,"600":0,"604":0,"614":0,"615":0,"616":0,"619":0,"620":0,"621":0,"623":0,"624":0,"627":0,"628":0,"630":0,"631":0,"632":0,"634":0,"635":0,"638":0,"639":0,"640":0,"643":0,"651":0,"657":0,"662":0,"663":0,"664":0,"665":0,"666":0,"668":0,"672":0,"676":0,"680":0};
+_yuitest_coverage["build/anim-base/anim-base.js"].functions = {"Anim:60":0,"DEFAULT_EASING:85":0,"get:106":0,"DEFAULT_SETTER:120":0,"DEFAULT_GETTER:147":0,"setter:176":0,"setter:208":0,"getter:281":0,"run:354":0,"pause:368":0,"stop:383":0,"_startTimer:392":0,"_stopTimer:398":0,"_runFrame:409":0,"run:431":0,"pause:447":0,"stop:460":0,"_start:469":0,"_pause:481":0,"_resume:495":0,"_end:510":0,"_runFrame:524":0,"_runAttrs:542":0,"_lastFrame:578":0,"(anonymous 2):614":0,"_initAnimAttr:603":0,"_getOffset:656":0,"destructor:675":0,"(anonymous 1):1":0};
+_yuitest_coverage["build/anim-base/anim-base.js"].coveredLines = 181;
+_yuitest_coverage["build/anim-base/anim-base.js"].coveredFunctions = 29;
+_yuitest_coverline("build/anim-base/anim-base.js", 1);
+YUI.add('anim-base', function (Y, NAME) {
+
+/**
+* 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
+ */
+
+ _yuitest_coverfunc("build/anim-base/anim-base.js", "(anonymous 1)", 1);
+_yuitest_coverline("build/anim-base/anim-base.js", 23);
+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;
+
+ _yuitest_coverline("build/anim-base/anim-base.js", 57);
+var _running = {},
+ _timer;
+
+ _yuitest_coverline("build/anim-base/anim-base.js", 60);
+Y.Anim = function() {
+ _yuitest_coverfunc("build/anim-base/anim-base.js", "Anim", 60);
+_yuitest_coverline("build/anim-base/anim-base.js", 61);
+Y.Anim.superclass.constructor.apply(this, arguments);
+ _yuitest_coverline("build/anim-base/anim-base.js", 62);
+Y.Anim._instances[Y.stamp(this)] = this;
+ };
+
+ _yuitest_coverline("build/anim-base/anim-base.js", 65);
+Y.Anim.NAME = 'anim';
+
+ _yuitest_coverline("build/anim-base/anim-base.js", 67);
+Y.Anim._instances = {};
+
+ /**
+ * Regex of properties that should use the default unit.
+ *
+ * @property RE_DEFAULT_UNIT
+ * @static
+ */
+ _yuitest_coverline("build/anim-base/anim-base.js", 75);
+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
+ */
+ _yuitest_coverline("build/anim-base/anim-base.js", 83);
+Y.Anim.DEFAULT_UNIT = 'px';
+
+ _yuitest_coverline("build/anim-base/anim-base.js", 85);
+Y.Anim.DEFAULT_EASING = function (t, b, c, d) {
+ _yuitest_coverfunc("build/anim-base/anim-base.js", "DEFAULT_EASING", 85);
+_yuitest_coverline("build/anim-base/anim-base.js", 86);
+return c * t / d + b; // linear easing
+ };
+
+ /**
+ * Time in milliseconds passed to setInterval for frame processing
+ *
+ * @property intervalTime
+ * @default 20
+ * @static
+ */
+ _yuitest_coverline("build/anim-base/anim-base.js", 96);
+Y.Anim._intervalTime = 20;
+
+ /**
+ * Bucket for custom getters and setters
+ *
+ * @property behaviors
+ * @static
+ */
+ _yuitest_coverline("build/anim-base/anim-base.js", 104);
+Y.Anim.behaviors = {
+ left: {
+ get: function(anim, attr) {
+ _yuitest_coverfunc("build/anim-base/anim-base.js", "get", 106);
+_yuitest_coverline("build/anim-base/anim-base.js", 107);
+return anim._getOffset(attr);
+ }
+ }
+ };
+
+ _yuitest_coverline("build/anim-base/anim-base.js", 112);
+Y.Anim.behaviors.top = Y.Anim.behaviors.left;
+
+ /**
+ * The default setter to use when setting object properties.
+ *
+ * @property DEFAULT_SETTER
+ * @static
+ */
+ _yuitest_coverline("build/anim-base/anim-base.js", 120);
+Y.Anim.DEFAULT_SETTER = function(anim, att, from, to, elapsed, duration, fn, unit) {
+ _yuitest_coverfunc("build/anim-base/anim-base.js", "DEFAULT_SETTER", 120);
+_yuitest_coverline("build/anim-base/anim-base.js", 121);
+var node = anim._node,
+ domNode = node._node,
+ val = fn(elapsed, NUM(from), NUM(to) - NUM(from), duration);
+
+ _yuitest_coverline("build/anim-base/anim-base.js", 125);
+if (domNode) {
+ _yuitest_coverline("build/anim-base/anim-base.js", 126);
+if ('style' in domNode && (att in domNode.style || att in Y.DOM.CUSTOM_STYLES)) {
+ _yuitest_coverline("build/anim-base/anim-base.js", 127);
+unit = unit || '';
+ _yuitest_coverline("build/anim-base/anim-base.js", 128);
+node.setStyle(att, val + unit);
+ } else {_yuitest_coverline("build/anim-base/anim-base.js", 129);
+if ('attributes' in domNode && att in domNode.attributes) {
+ _yuitest_coverline("build/anim-base/anim-base.js", 130);
+node.setAttribute(att, val);
+ } else {_yuitest_coverline("build/anim-base/anim-base.js", 131);
+if (att in domNode) {
+ _yuitest_coverline("build/anim-base/anim-base.js", 132);
+domNode[att] = val;
+ }}}
+ } else {_yuitest_coverline("build/anim-base/anim-base.js", 134);
+if (node.set) {
+ _yuitest_coverline("build/anim-base/anim-base.js", 135);
+node.set(att, val);
+ } else {_yuitest_coverline("build/anim-base/anim-base.js", 136);
+if (att in node) {
+ _yuitest_coverline("build/anim-base/anim-base.js", 137);
+node[att] = val;
+ }}}
+ };
+
+ /**
+ * The default getter to use when getting object properties.
+ *
+ * @property DEFAULT_GETTER
+ * @static
+ */
+ _yuitest_coverline("build/anim-base/anim-base.js", 147);
+Y.Anim.DEFAULT_GETTER = function(anim, att) {
+ _yuitest_coverfunc("build/anim-base/anim-base.js", "DEFAULT_GETTER", 147);
+_yuitest_coverline("build/anim-base/anim-base.js", 148);
+var node = anim._node,
+ domNode = node._node,
+ val = '';
+
+ _yuitest_coverline("build/anim-base/anim-base.js", 152);
+if (domNode) {
+ _yuitest_coverline("build/anim-base/anim-base.js", 153);
+if ('style' in domNode && (att in domNode.style || att in Y.DOM.CUSTOM_STYLES)) {
+ _yuitest_coverline("build/anim-base/anim-base.js", 154);
+val = node.getComputedStyle(att);
+ } else {_yuitest_coverline("build/anim-base/anim-base.js", 155);
+if ('attributes' in domNode && att in domNode.attributes) {
+ _yuitest_coverline("build/anim-base/anim-base.js", 156);
+val = node.getAttribute(att);
+ } else {_yuitest_coverline("build/anim-base/anim-base.js", 157);
+if (att in domNode) {
+ _yuitest_coverline("build/anim-base/anim-base.js", 158);
+val = domNode[att];
+ }}}
+ } else {_yuitest_coverline("build/anim-base/anim-base.js", 160);
+if (node.get) {
+ _yuitest_coverline("build/anim-base/anim-base.js", 161);
+val = node.get(att);
+ } else {_yuitest_coverline("build/anim-base/anim-base.js", 162);
+if (att in node) {
+ _yuitest_coverline("build/anim-base/anim-base.js", 163);
+val = node[att];
+ }}}
+
+ _yuitest_coverline("build/anim-base/anim-base.js", 166);
+return val;
+ };
+
+ _yuitest_coverline("build/anim-base/anim-base.js", 169);
+Y.Anim.ATTRS = {
+ /**
+ * The object to be animated.
+ * @attribute node
+ * @type Node
+ */
+ node: {
+ setter: function(node) {
+ _yuitest_coverfunc("build/anim-base/anim-base.js", "setter", 176);
+_yuitest_coverline("build/anim-base/anim-base.js", 177);
+if (node) {
+ _yuitest_coverline("build/anim-base/anim-base.js", 178);
+if (typeof node == 'string' || node.nodeType) {
+ _yuitest_coverline("build/anim-base/anim-base.js", 179);
+node = Y.one(node);
+ }
+ }
+
+ _yuitest_coverline("build/anim-base/anim-base.js", 183);
+this._node = node;
+ _yuitest_coverline("build/anim-base/anim-base.js", 184);
+if (!node) {
+ }
+ _yuitest_coverline("build/anim-base/anim-base.js", 186);
+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) {
+ _yuitest_coverfunc("build/anim-base/anim-base.js", "setter", 208);
+_yuitest_coverline("build/anim-base/anim-base.js", 209);
+if (typeof val === 'string' && Y.Easing) {
+ _yuitest_coverline("build/anim-base/anim-base.js", 210);
+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.
+ * 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).
+ *
+ * @attribute from
+ * @type Object
+ */
+ from: {},
+
+ /**
+ * The ending values for the animated properties.
+ *
+ * Fields may be strings, numbers, or functions.
+ * 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).
+ *
+ * @attribute to
+ * @type Object
+ */
+ 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() {
+ _yuitest_coverfunc("build/anim-base/anim-base.js", "getter", 281);
+_yuitest_coverline("build/anim-base/anim-base.js", 282);
+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
+ */
+ _yuitest_coverline("build/anim-base/anim-base.js", 354);
+Y.Anim.run = function() {
+ _yuitest_coverfunc("build/anim-base/anim-base.js", "run", 354);
+_yuitest_coverline("build/anim-base/anim-base.js", 355);
+var instances = Y.Anim._instances;
+ _yuitest_coverline("build/anim-base/anim-base.js", 356);
+for (var i in instances) {
+ _yuitest_coverline("build/anim-base/anim-base.js", 357);
+if (instances[i].run) {
+ _yuitest_coverline("build/anim-base/anim-base.js", 358);
+instances[i].run();
+ }
+ }
+ };
+
+ /**
+ * Pauses all animation instances.
+ * @method pause
+ * @static
+ */
+ _yuitest_coverline("build/anim-base/anim-base.js", 368);
+Y.Anim.pause = function() {
+ _yuitest_coverfunc("build/anim-base/anim-base.js", "pause", 368);
+_yuitest_coverline("build/anim-base/anim-base.js", 369);
+for (var i in _running) { // stop timer if nothing running
+ _yuitest_coverline("build/anim-base/anim-base.js", 370);
+if (_running[i].pause) {
+ _yuitest_coverline("build/anim-base/anim-base.js", 371);
+_running[i].pause();
+ }
+ }
+
+ _yuitest_coverline("build/anim-base/anim-base.js", 375);
+Y.Anim._stopTimer();
+ };
+
+ /**
+ * Stops all animation instances.
+ * @method stop
+ * @static
+ */
+ _yuitest_coverline("build/anim-base/anim-base.js", 383);
+Y.Anim.stop = function() {
+ _yuitest_coverfunc("build/anim-base/anim-base.js", "stop", 383);
+_yuitest_coverline("build/anim-base/anim-base.js", 384);
+for (var i in _running) { // stop timer if nothing running
+ _yuitest_coverline("build/anim-base/anim-base.js", 385);
+if (_running[i].stop) {
+ _yuitest_coverline("build/anim-base/anim-base.js", 386);
+_running[i].stop();
+ }
+ }
+ _yuitest_coverline("build/anim-base/anim-base.js", 389);
+Y.Anim._stopTimer();
+ };
+
+ _yuitest_coverline("build/anim-base/anim-base.js", 392);
+Y.Anim._startTimer = function() {
+ _yuitest_coverfunc("build/anim-base/anim-base.js", "_startTimer", 392);
+_yuitest_coverline("build/anim-base/anim-base.js", 393);
+if (!_timer) {
+ _yuitest_coverline("build/anim-base/anim-base.js", 394);
+_timer = setInterval(Y.Anim._runFrame, Y.Anim._intervalTime);
+ }
+ };
+
+ _yuitest_coverline("build/anim-base/anim-base.js", 398);
+Y.Anim._stopTimer = function() {
+ _yuitest_coverfunc("build/anim-base/anim-base.js", "_stopTimer", 398);
+_yuitest_coverline("build/anim-base/anim-base.js", 399);
+clearInterval(_timer);
+ _yuitest_coverline("build/anim-base/anim-base.js", 400);
+_timer = 0;
+ };
+
+ /**
+ * Called per Interval to handle each animation frame.
+ * @method _runFrame
+ * @private
+ * @static
+ */
+ _yuitest_coverline("build/anim-base/anim-base.js", 409);
+Y.Anim._runFrame = function() {
+ _yuitest_coverfunc("build/anim-base/anim-base.js", "_runFrame", 409);
+_yuitest_coverline("build/anim-base/anim-base.js", 410);
+var done = true;
+ _yuitest_coverline("build/anim-base/anim-base.js", 411);
+for (var anim in _running) {
+ _yuitest_coverline("build/anim-base/anim-base.js", 412);
+if (_running[anim]._runFrame) {
+ _yuitest_coverline("build/anim-base/anim-base.js", 413);
+done = false;
+ _yuitest_coverline("build/anim-base/anim-base.js", 414);
+_running[anim]._runFrame();
+ }
+ }
+
+ _yuitest_coverline("build/anim-base/anim-base.js", 418);
+if (done) {
+ _yuitest_coverline("build/anim-base/anim-base.js", 419);
+Y.Anim._stopTimer();
+ }
+ };
+
+ _yuitest_coverline("build/anim-base/anim-base.js", 423);
+Y.Anim.RE_UNITS = /^(-?\d*\.?\d*){1}(em|ex|px|in|cm|mm|pt|pc|%)*$/;
+
+ _yuitest_coverline("build/anim-base/anim-base.js", 425);
+var proto = {
+ /**
+ * Starts or resumes an animation.
+ * @method run
+ * @chainable
+ */
+ run: function() {
+ _yuitest_coverfunc("build/anim-base/anim-base.js", "run", 431);
+_yuitest_coverline("build/anim-base/anim-base.js", 432);
+if (this.get(PAUSED)) {
+ _yuitest_coverline("build/anim-base/anim-base.js", 433);
+this._resume();
+ } else {_yuitest_coverline("build/anim-base/anim-base.js", 434);
+if (!this.get(RUNNING)) {
+ _yuitest_coverline("build/anim-base/anim-base.js", 435);
+this._start();
+ }}
+ _yuitest_coverline("build/anim-base/anim-base.js", 437);
+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() {
+ _yuitest_coverfunc("build/anim-base/anim-base.js", "pause", 447);
+_yuitest_coverline("build/anim-base/anim-base.js", 448);
+if (this.get(RUNNING)) {
+ _yuitest_coverline("build/anim-base/anim-base.js", 449);
+this._pause();
+ }
+ _yuitest_coverline("build/anim-base/anim-base.js", 451);
+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) {
+ _yuitest_coverfunc("build/anim-base/anim-base.js", "stop", 460);
+_yuitest_coverline("build/anim-base/anim-base.js", 461);
+if (this.get(RUNNING) || this.get(PAUSED)) {
+ _yuitest_coverline("build/anim-base/anim-base.js", 462);
+this._end(finish);
+ }
+ _yuitest_coverline("build/anim-base/anim-base.js", 464);
+return this;
+ },
+
+ _added: false,
+
+ _start: function() {
+ _yuitest_coverfunc("build/anim-base/anim-base.js", "_start", 469);
+_yuitest_coverline("build/anim-base/anim-base.js", 470);
+this._set(START_TIME, new Date() - this.get(ELAPSED_TIME));
+ _yuitest_coverline("build/anim-base/anim-base.js", 471);
+this._actualFrames = 0;
+ _yuitest_coverline("build/anim-base/anim-base.js", 472);
+if (!this.get(PAUSED)) {
+ _yuitest_coverline("build/anim-base/anim-base.js", 473);
+this._initAnimAttr();
+ }
+ _yuitest_coverline("build/anim-base/anim-base.js", 475);
+_running[Y.stamp(this)] = this;
+ _yuitest_coverline("build/anim-base/anim-base.js", 476);
+Y.Anim._startTimer();
+
+ _yuitest_coverline("build/anim-base/anim-base.js", 478);
+this.fire(START);
+ },
+
+ _pause: function() {
+ _yuitest_coverfunc("build/anim-base/anim-base.js", "_pause", 481);
+_yuitest_coverline("build/anim-base/anim-base.js", 482);
+this._set(START_TIME, null);
+ _yuitest_coverline("build/anim-base/anim-base.js", 483);
+this._set(PAUSED, true);
+ _yuitest_coverline("build/anim-base/anim-base.js", 484);
+delete _running[Y.stamp(this)];
+
+ /**
+ * @event pause
+ * @description fires when an animation is paused.
+ * @param {Event} ev The pause event.
+ * @type Event.Custom
+ */
+ _yuitest_coverline("build/anim-base/anim-base.js", 492);
+this.fire('pause');
+ },
+
+ _resume: function() {
+ _yuitest_coverfunc("build/anim-base/anim-base.js", "_resume", 495);
+_yuitest_coverline("build/anim-base/anim-base.js", 496);
+this._set(PAUSED, false);
+ _yuitest_coverline("build/anim-base/anim-base.js", 497);
+_running[Y.stamp(this)] = this;
+ _yuitest_coverline("build/anim-base/anim-base.js", 498);
+this._set(START_TIME, new Date() - this.get(ELAPSED_TIME));
+ _yuitest_coverline("build/anim-base/anim-base.js", 499);
+Y.Anim._startTimer();
+
+ /**
+ * @event resume
+ * @description fires when an animation is resumed (run from pause).
+ * @param {Event} ev The pause event.
+ * @type Event.Custom
+ */
+ _yuitest_coverline("build/anim-base/anim-base.js", 507);
+this.fire('resume');
+ },
+
+ _end: function(finish) {
+ _yuitest_coverfunc("build/anim-base/anim-base.js", "_end", 510);
+_yuitest_coverline("build/anim-base/anim-base.js", 511);
+var duration = this.get('duration') * 1000;
+ _yuitest_coverline("build/anim-base/anim-base.js", 512);
+if (finish) { // jump to last frame
+ _yuitest_coverline("build/anim-base/anim-base.js", 513);
+this._runAttrs(duration, duration, this.get(REVERSE));
+ }
+
+ _yuitest_coverline("build/anim-base/anim-base.js", 516);
+this._set(START_TIME, null);
+ _yuitest_coverline("build/anim-base/anim-base.js", 517);
+this._set(ELAPSED_TIME, 0);
+ _yuitest_coverline("build/anim-base/anim-base.js", 518);
+this._set(PAUSED, false);
+
+ _yuitest_coverline("build/anim-base/anim-base.js", 520);
+delete _running[Y.stamp(this)];
+ _yuitest_coverline("build/anim-base/anim-base.js", 521);
+this.fire(END, {elapsed: this.get(ELAPSED_TIME)});
+ },
+
+ _runFrame: function() {
+ _yuitest_coverfunc("build/anim-base/anim-base.js", "_runFrame", 524);
+_yuitest_coverline("build/anim-base/anim-base.js", 525);
+var d = this._runtimeAttr.duration,
+ t = new Date() - this.get(START_TIME),
+ reverse = this.get(REVERSE),
+ done = (t >= d),
+ attribute,
+ setter;
+
+ _yuitest_coverline("build/anim-base/anim-base.js", 532);
+this._runAttrs(t, d, reverse);
+ _yuitest_coverline("build/anim-base/anim-base.js", 533);
+this._actualFrames += 1;
+ _yuitest_coverline("build/anim-base/anim-base.js", 534);
+this._set(ELAPSED_TIME, t);
+
+ _yuitest_coverline("build/anim-base/anim-base.js", 536);
+this.fire(TWEEN);
+ _yuitest_coverline("build/anim-base/anim-base.js", 537);
+if (done) {
+ _yuitest_coverline("build/anim-base/anim-base.js", 538);
+this._lastFrame();
+ }
+ },
+
+ _runAttrs: function(t, d, reverse) {
+ _yuitest_coverfunc("build/anim-base/anim-base.js", "_runAttrs", 542);
+_yuitest_coverline("build/anim-base/anim-base.js", 543);
+var attr = this._runtimeAttr,
+ customAttr = Y.Anim.behaviors,
+ easing = attr.easing,
+ lastFrame = d,
+ done = false,
+ attribute,
+ setter,
+ i;
+
+ _yuitest_coverline("build/anim-base/anim-base.js", 552);
+if (t >= d) {
+ _yuitest_coverline("build/anim-base/anim-base.js", 553);
+done = true;
+ }
+
+ _yuitest_coverline("build/anim-base/anim-base.js", 556);
+if (reverse) {
+ _yuitest_coverline("build/anim-base/anim-base.js", 557);
+t = d - t;
+ _yuitest_coverline("build/anim-base/anim-base.js", 558);
+lastFrame = 0;
+ }
+
+ _yuitest_coverline("build/anim-base/anim-base.js", 561);
+for (i in attr) {
+ _yuitest_coverline("build/anim-base/anim-base.js", 562);
+if (attr[i].to) {
+ _yuitest_coverline("build/anim-base/anim-base.js", 563);
+attribute = attr[i];
+ _yuitest_coverline("build/anim-base/anim-base.js", 564);
+setter = (i in customAttr && 'set' in customAttr[i]) ?
+ customAttr[i].set : Y.Anim.DEFAULT_SETTER;
+
+ _yuitest_coverline("build/anim-base/anim-base.js", 567);
+if (!done) {
+ _yuitest_coverline("build/anim-base/anim-base.js", 568);
+setter(this, i, attribute.from, attribute.to, t, d, easing, attribute.unit);
+ } else {
+ _yuitest_coverline("build/anim-base/anim-base.js", 570);
+setter(this, i, attribute.from, attribute.to, lastFrame, d, easing, attribute.unit);
+ }
+ }
+ }
+
+
+ },
+
+ _lastFrame: function() {
+ _yuitest_coverfunc("build/anim-base/anim-base.js", "_lastFrame", 578);
+_yuitest_coverline("build/anim-base/anim-base.js", 579);
+var iter = this.get('iterations'),
+ iterCount = this.get(ITERATION_COUNT);
+
+ _yuitest_coverline("build/anim-base/anim-base.js", 582);
+iterCount += 1;
+ _yuitest_coverline("build/anim-base/anim-base.js", 583);
+if (iter === 'infinite' || iterCount < iter) {
+ _yuitest_coverline("build/anim-base/anim-base.js", 584);
+if (this.get('direction') === 'alternate') {
+ _yuitest_coverline("build/anim-base/anim-base.js", 585);
+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
+ */
+ _yuitest_coverline("build/anim-base/anim-base.js", 593);
+this.fire('iteration');
+ } else {
+ _yuitest_coverline("build/anim-base/anim-base.js", 595);
+iterCount = 0;
+ _yuitest_coverline("build/anim-base/anim-base.js", 596);
+this._end();
+ }
+
+ _yuitest_coverline("build/anim-base/anim-base.js", 599);
+this._set(START_TIME, new Date());
+ _yuitest_coverline("build/anim-base/anim-base.js", 600);
+this._set(ITERATION_COUNT, iterCount);
+ },
+
+ _initAnimAttr: function() {
+ _yuitest_coverfunc("build/anim-base/anim-base.js", "_initAnimAttr", 603);
+_yuitest_coverline("build/anim-base/anim-base.js", 604);
+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;
+
+ _yuitest_coverline("build/anim-base/anim-base.js", 614);
+Y.each(to, function(val, name) {
+ _yuitest_coverfunc("build/anim-base/anim-base.js", "(anonymous 2)", 614);
+_yuitest_coverline("build/anim-base/anim-base.js", 615);
+if (typeof val === 'function') {
+ _yuitest_coverline("build/anim-base/anim-base.js", 616);
+val = val.call(this, node);
+ }
+
+ _yuitest_coverline("build/anim-base/anim-base.js", 619);
+begin = from[name];
+ _yuitest_coverline("build/anim-base/anim-base.js", 620);
+if (begin === undefined) {
+ _yuitest_coverline("build/anim-base/anim-base.js", 621);
+begin = (name in customAttr && 'get' in customAttr[name]) ?
+ customAttr[name].get(this, name) : Y.Anim.DEFAULT_GETTER(this, name);
+ } else {_yuitest_coverline("build/anim-base/anim-base.js", 623);
+if (typeof begin === 'function') {
+ _yuitest_coverline("build/anim-base/anim-base.js", 624);
+begin = begin.call(this, node);
+ }}
+
+ _yuitest_coverline("build/anim-base/anim-base.js", 627);
+var mFrom = Y.Anim.RE_UNITS.exec(begin);
+ _yuitest_coverline("build/anim-base/anim-base.js", 628);
+var mTo = Y.Anim.RE_UNITS.exec(val);
+
+ _yuitest_coverline("build/anim-base/anim-base.js", 630);
+begin = mFrom ? mFrom[1] : begin;
+ _yuitest_coverline("build/anim-base/anim-base.js", 631);
+end = mTo ? mTo[1] : val;
+ _yuitest_coverline("build/anim-base/anim-base.js", 632);
+unit = mTo ? mTo[2] : mFrom ? mFrom[2] : ''; // one might be zero TODO: mixed units
+
+ _yuitest_coverline("build/anim-base/anim-base.js", 634);
+if (!unit && Y.Anim.RE_DEFAULT_UNIT.test(name)) {
+ _yuitest_coverline("build/anim-base/anim-base.js", 635);
+unit = Y.Anim.DEFAULT_UNIT;
+ }
+
+ _yuitest_coverline("build/anim-base/anim-base.js", 638);
+if (!begin || !end) {
+ _yuitest_coverline("build/anim-base/anim-base.js", 639);
+Y.error('invalid "from" or "to" for "' + name + '"', 'Anim');
+ _yuitest_coverline("build/anim-base/anim-base.js", 640);
+return;
+ }
+
+ _yuitest_coverline("build/anim-base/anim-base.js", 643);
+attr[name] = {
+ from: Y.Lang.isObject(begin) ? Y.clone(begin) : begin,
+ to: end,
+ unit: unit
+ };
+
+ }, this);
+
+ _yuitest_coverline("build/anim-base/anim-base.js", 651);
+this._runtimeAttr = attr;
+ },
+
+
+ // TODO: move to computedStyle? (browsers dont agree on default computed offsets)
+ _getOffset: function(attr) {
+ _yuitest_coverfunc("build/anim-base/anim-base.js", "_getOffset", 656);
+_yuitest_coverline("build/anim-base/anim-base.js", 657);
+var node = this._node,
+ val = node.getComputedStyle(attr),
+ get = (attr === 'left') ? 'getX': 'getY',
+ set = (attr === 'left') ? 'setX': 'setY';
+
+ _yuitest_coverline("build/anim-base/anim-base.js", 662);
+if (val === 'auto') {
+ _yuitest_coverline("build/anim-base/anim-base.js", 663);
+var position = node.getStyle('position');
+ _yuitest_coverline("build/anim-base/anim-base.js", 664);
+if (position === 'absolute' || position === 'fixed') {
+ _yuitest_coverline("build/anim-base/anim-base.js", 665);
+val = node[get]();
+ _yuitest_coverline("build/anim-base/anim-base.js", 666);
+node[set](val);
+ } else {
+ _yuitest_coverline("build/anim-base/anim-base.js", 668);
+val = 0;
+ }
+ }
+
+ _yuitest_coverline("build/anim-base/anim-base.js", 672);
+return val;
+ },
+
+ destructor: function() {
+ _yuitest_coverfunc("build/anim-base/anim-base.js", "destructor", 675);
+_yuitest_coverline("build/anim-base/anim-base.js", 676);
+delete Y.Anim._instances[Y.stamp(this)];
+ }
+ };
+
+ _yuitest_coverline("build/anim-base/anim-base.js", 680);
+Y.extend(Y.Anim, Y.Base, proto);
+
+
+}, '@VERSION@', {"requires": ["base-base", "node-style"]});
View
6 build/anim-base/anim-base-debug.js
@@ -1,4 +1,4 @@
-YUI.add('anim-base', function(Y) {
+YUI.add('anim-base', function (Y, NAME) {
/**
* The Animation Utility provides an API for creating advanced transitions.
@@ -642,7 +642,7 @@ YUI.add('anim-base', function(Y) {
}
attr[name] = {
- from: begin,
+ from: Y.Lang.isObject(begin) ? Y.clone(begin) : begin,
to: end,
unit: unit
};
@@ -681,4 +681,4 @@ YUI.add('anim-base', function(Y) {
Y.extend(Y.Anim, Y.Base, proto);
-}, '@VERSION@' ,{requires:['base-base', 'node-style']});
+}, '@VERSION@', {"requires": ["base-base", "node-style"]});
View
2  build/anim-base/anim-base-min.js
@@ -1 +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(t,u,w,x,z,s,v,y){var q=t._node,r=q._node,p=v(z,a(w),a(x)-a(w),s);if(r){if("style" in r&&(u in r.style||u in b.DOM.CUSTOM_STYLES)){y=y||"";q.setStyle(u,p+y);}else{if("attributes" in r&&u in r.attributes){q.setAttribute(u,p);}else{if(u in r){r[u]=p;}}}}else{if(q.set){q.set(u,p);}else{if(u in q){q[u]=p;}}}};b.Anim.DEFAULT_GETTER=function(s,p){var r=s._node,q=r._node,t="";if(q){if("style" in q&&(p in q.style||p in b.DOM.CUSTOM_STYLES)){t=r.getComputedStyle(p);}else{if("attributes" in q&&p in q.attributes){t=r.getAttribute(p);}else{if(p in q){t=q[p];}}}}else{if(r.get){t=r.get(p);}else{if(p in r){t=r[p];}}}return t;};b.Anim.ATTRS={node:{setter:function(p){if(p){if(typeof p=="string"||p.nodeType){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"]});
+YUI.add("anim-base",function(e,t){var n="running",r="startTime",i="elapsedTime",s="start",o="tween",u="end",a="node",f="paused",l="reverse",c="iterationCount",h=Number,p={},d;e.Anim=function(){e.Anim.superclass.constructor.apply(this,arguments),e.Anim._instances[e.stamp(this)]=this},e.Anim.NAME="anim",e.Anim._instances={},e.Anim.RE_DEFAULT_UNIT=/^width|height|top|right|bottom|left|margin.*|padding.*|border.*$/i,e.Anim.DEFAULT_UNIT="px",e.Anim.DEFAULT_EASING=function(e,t,n,r){return n*e/r+t},e.Anim._intervalTime=20,e.Anim.behaviors={left:{get:function(e,t){return e._getOffset(t)}}},e.Anim.behaviors.top=e.Anim.behaviors.left,e.Anim.DEFAULT_SETTER=function(t,n,r,i,s,o,u,a){var f=t._node,l=f._node,c=u(s,h(r),h(i)-h(r),o);l?"style"in l&&(n in l.style||n in e.DOM.CUSTOM_STYLES)?(a=a||"",f.setStyle(n,c+a)):"attributes"in l&&n in l.attributes?f.setAttribute(n,c):n in l&&(l[n]=c):f.set?f.set(n,c):n in f&&(f[n]=c)},e.Anim.DEFAULT_GETTER=function(t,n){var r=t._node,i=r._node,s="";return i?"style"in i&&(n in i.style||n in e.DOM.CUSTOM_STYLES)?s=r.getComputedStyle(n):"attributes"in i&&n in i.attributes?s=r.getAttribute(n):n in i&&(s=i[n]):r.get?s=r.get(n):n in r&&(s=r[n]),s},e.Anim.ATTRS={node:{setter:function(t){return t&&(typeof t=="string"||t.nodeType)&&(t=e.one(t)),this._node=t,!t,t}},duration:{value:1},easing:{value:e.Anim.DEFAULT_EASING,setter:function(t){if(typeof t=="string"&&e.Easing)return e.Easing[t]}},from:{},to:{},startTime:{value:0,readOnly:!0},elapsedTime:{value:0,readOnly:!0},running:{getter:function(){return!!p[e.stamp(this)]},value:!1,readOnly:!0},iterations:{value:1},iterationCount:{value:0,readOnly:!0},direction:{value:"normal"},paused:{readOnly:!0,value:!1},reverse:{value:!1}},e.Anim.run=function(){var t=e.Anim._instances;for(var n in t)t[n].run&&t[n].run()},e.Anim.pause=function(){for(var t in p)p[t].pause&&p[t].pause();e.Anim._stopTimer()},e.Anim.stop=function(){for(var t in p)p[t].stop&&p[t].stop();e.Anim._stopTimer()},e.Anim._startTimer=function(){d||(d=setInterval(e.Anim._runFrame,e.Anim._intervalTime))},e.Anim._stopTimer=function(){clearInterval(d),d=0},e.Anim._runFrame=function(){var t=!0;for(var n in p)p[n]._runFrame&&(t=!1,p[n]._runFrame());t&&e.Anim._stopTimer()},e.Anim.RE_UNITS=/^(-?\d*\.?\d*){1}(em|ex|px|in|cm|mm|pt|pc|%)*$/;var v={run:function(){return this.get(f)?this._resume():this.get(n)||this._start(),this},pause:function(){return this.get(n)&&this._pause(),this},stop:function(e){return(this.get(n)||this.get(f))&&this._end(e),this},_added:!1,_start:function(){this._set(r,new Date-this.get(i)),this._actualFrames=0,this.get(f)||this._initAnimAttr(),p[e.stamp(this)]=this,e.Anim._startTimer(),this.fire(s)},_pause:function(){this._set(r,null),this._set(f,!0),delete p[e.stamp(this)],this.fire("pause")},_resume:function(){this._set(f,!1),p[e.stamp(this)]=this,this._set(r,new Date-this.get(i)),e.Anim._startTimer(),this.fire("resume")},_end:function(t){var n=this.get("duration")*1e3;t&&this._runAttrs(n,n,this.get(l)),this._set(r,null),this._set(i,0),this._set(f,!1),delete p[e.stamp(this)],this.fire(u,{elapsed:this.get(i)})},_runFrame:function(){var e=this._runtimeAttr.duration,t=new Date-this.get(r),n=this.get(l),s=t>=e,u,a;this._runAttrs(t,e,n),this._actualFrames+=1,this._set(i,t),this.fire(o),s&&this._lastFrame()},_runAttrs:function(t,n,r){var i=this._runtimeAttr,s=e.Anim.behaviors,o=i.easing,u=n,a=!1,f,l,c;t>=n&&(a=!0),r&&(t=n-t,u=0);for(c in i)i[c].to&&(f=i[c],l=c in s&&"set"in s[c]?s[c].set:e.Anim.DEFAULT_SETTER,a?l(this,c,f.from,f.to,u,n,o,f.unit):l(this,c,f.from,f.to,t,n,o,f.unit))},_lastFrame:function(){var e=this.get("iterations"),t=this.get(c);t+=1,e==="infinite"||t<e?(this.get("direction")==="alternate"&&this.set(l,!this.get(l)),this.fire("iteration")):(t=0,this._end()),this._set(r,new Date),this._set(c,t)},_initAnimAttr:function(){var t=this.get("from")||{},n=this.get("to")||{},r={duration:this.get("duration")*1e3,easing:this.get("easing")},i=e.Anim.behaviors,s=this.get(a),o,u,f;e.each(n,function(n,a){typeof n=="function"&&(n=n.call(this,s)),u=t[a],u===undefined?u=a in i&&"get"in i[a]?i[a].get(this,a):e.Anim.DEFAULT_GETTER(this,a):typeof u=="function"&&(u=u.call(this,s));var l=e.Anim.RE_UNITS.exec(u),c=e.Anim.RE_UNITS.exec(n);u=l?l[1]:u,f=c?c[1]:n,o=c?c[2]:l?l[2]:"",!o&&e.Anim.RE_DEFAULT_UNIT.test(a)&&(o=e.Anim.DEFAULT_UNIT);if(!u||!f){e.error('invalid "from" or "to" for "'+a+'"',"Anim");return}r[a]={from:e.Lang.isObject(u)?e.clone(u):u,to:f,unit:o}},this),this._runtimeAttr=r},_getOffset:function(e){var t=this._node,n=t.getComputedStyle(e),r=e==="left"?"getX":"getY",i=e==="left"?"setX":"setY";if(n==="auto"){var s=t.getStyle("position");s==="absolute"||s==="fixed"?(n=t[r](),t[i](n)):n=0}return n},destructor:function(){delete e.Anim._instances[e.stamp(this)]}};e.extend(e.Anim,e.Base,v)},"@VERSION@",{requires:["base-base","node-style"]});
View
6 build/anim-base/anim-base.js
@@ -1,4 +1,4 @@
-YUI.add('anim-base', function(Y) {
+YUI.add('anim-base', function (Y, NAME) {
/**
* The Animation Utility provides an API for creating advanced transitions.
@@ -641,7 +641,7 @@ YUI.add('anim-base', function(Y) {
}
attr[name] = {
- from: begin,
+ from: Y.Lang.isObject(begin) ? Y.clone(begin) : begin,
to: end,
unit: unit
};
@@ -680,4 +680,4 @@ YUI.add('anim-base', function(Y) {
Y.extend(Y.Anim, Y.Base, proto);
-}, '@VERSION@' ,{requires:['base-base', 'node-style']});
+}, '@VERSION@', {"requires": ["base-base", "node-style"]});
View
106 build/anim-color/anim-color-coverage.js
@@ -0,0 +1,106 @@
+if (typeof _yuitest_coverage == "undefined"){
+ _yuitest_coverage = {};
+ _yuitest_coverline = function(src, line){
+ var coverage = _yuitest_coverage[src];
+ if (!coverage.lines[line]){
+ coverage.calledLines++;
+ }
+ coverage.lines[line]++;
+ };
+ _yuitest_coverfunc = function(src, name, line){
+ var coverage = _yuitest_coverage[src],
+ funcId = name + ":" + line;
+ if (!coverage.functions[funcId]){
+ coverage.calledFunctions++;
+ }
+ coverage.functions[funcId]++;
+ };
+}
+_yuitest_coverage["build/anim-color/anim-color.js"] = {
+ lines: {},
+ functions: {},
+ coveredLines: 0,
+ calledLines: 0,
+ coveredFunctions: 0,
+ calledFunctions: 0,
+ path: "build/anim-color/anim-color.js",
+ code: []
+};
+_yuitest_coverage["build/anim-color/anim-color.js"].code=["YUI.add('anim-color', function (Y, NAME) {","","/**"," * Adds support for color properties in <code>to</code>"," * and <code>from</code> attributes."," * @module anim"," * @submodule anim-color"," */","","var NUM = Number;","","Y.Anim.getUpdatedColorValue = function(fromColor, toColor, elapsed, duration, fn)","{"," fromColor = Y.Color.re_RGB.exec(Y.Color.toRGB(fromColor));"," toColor = Y.Color.re_RGB.exec(Y.Color.toRGB(toColor));",""," if (!fromColor || fromColor.length < 3 || !toColor || toColor.length < 3) {"," Y.error('invalid from or to passed to color behavior');"," }",""," return 'rgb(' + ["," Math.floor(fn(elapsed, NUM(fromColor[1]), NUM(toColor[1]) - NUM(fromColor[1]), duration)),"," Math.floor(fn(elapsed, NUM(fromColor[2]), NUM(toColor[2]) - NUM(fromColor[2]), duration)),"," Math.floor(fn(elapsed, NUM(fromColor[3]), NUM(toColor[3]) - NUM(fromColor[3]), duration))"," ].join(', ') + ')';","};","","Y.Anim.behaviors.color = {"," set: function(anim, att, from, to, elapsed, duration, fn) {"," anim._node.setStyle(att, Y.Anim.getUpdatedColorValue(from, to, elapsed, duration, fn)); "," },"," "," // 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\"]});"];
+_yuitest_coverage["build/anim-color/anim-color.js"].lines = {"1":0,"10":0,"12":0,"14":0,"15":0,"17":0,"18":0,"21":0,"28":0,"30":0,"35":0,"36":0,"37":0,"41":0,"48":0};
+_yuitest_coverage["build/anim-color/anim-color.js"].functions = {"getUpdatedColorValue:12":0,"set:29":0,"get:34":0,"(anonymous 2):47":0,"(anonymous 1):1":0};
+_yuitest_coverage["build/anim-color/anim-color.js"].coveredLines = 15;
+_yuitest_coverage["build/anim-color/anim-color.js"].coveredFunctions = 5;
+_yuitest_coverline("build/anim-color/anim-color.js", 1);
+YUI.add('anim-color', function (Y, NAME) {
+
+/**
+ * Adds support for color properties in <code>to</code>
+ * and <code>from</code> attributes.
+ * @module anim
+ * @submodule anim-color
+ */
+
+_yuitest_coverfunc("build/anim-color/anim-color.js", "(anonymous 1)", 1);
+_yuitest_coverline("build/anim-color/anim-color.js", 10);
+var NUM = Number;
+
+_yuitest_coverline("build/anim-color/anim-color.js", 12);
+Y.Anim.getUpdatedColorValue = function(fromColor, toColor, elapsed, duration, fn)
+{
+ _yuitest_coverfunc("build/anim-color/anim-color.js", "getUpdatedColorValue", 12);
+_yuitest_coverline("build/anim-color/anim-color.js", 14);
+fromColor = Y.Color.re_RGB.exec(Y.Color.toRGB(fromColor));
+ _yuitest_coverline("build/anim-color/anim-color.js", 15);
+toColor = Y.Color.re_RGB.exec(Y.Color.toRGB(toColor));
+
+ _yuitest_coverline("build/anim-color/anim-color.js", 17);
+if (!fromColor || fromColor.length < 3 || !toColor || toColor.length < 3) {
+ _yuitest_coverline("build/anim-color/anim-color.js", 18);
+Y.error('invalid from or to passed to color behavior');
+ }
+
+ _yuitest_coverline("build/anim-color/anim-color.js", 21);
+return 'rgb(' + [
+ Math.floor(fn(elapsed, NUM(fromColor[1]), NUM(toColor[1]) - NUM(fromColor[1]), duration)),
+ Math.floor(fn(elapsed, NUM(fromColor[2]), NUM(toColor[2]) - NUM(fromColor[2]), duration)),
+ Math.floor(fn(elapsed, NUM(fromColor[3]), NUM(toColor[3]) - NUM(fromColor[3]), duration))
+ ].join(', ') + ')';
+};
+
+_yuitest_coverline("build/anim-color/anim-color.js", 28);
+Y.Anim.behaviors.color = {
+ set: function(anim, att, from, to, elapsed, duration, fn) {
+ _yuitest_coverfunc("build/anim-color/anim-color.js", "set", 29);
+_yuitest_coverline("build/anim-color/anim-color.js", 30);
+anim._node.setStyle(att, Y.Anim.getUpdatedColorValue(from, to, elapsed, duration, fn));
+ },
+
+ // TODO: default bgcolor const
+ get: function(anim, att) {
+ _yuitest_coverfunc("build/anim-color/anim-color.js", "get", 34);
+_yuitest_coverline("build/anim-color/anim-color.js", 35);
+var val = anim._node.getComputedStyle(att);
+ _yuitest_coverline("build/anim-color/anim-color.js", 36);
+val = (val === 'transparent') ? 'rgb(255, 255, 255)' : val;
+ _yuitest_coverline("build/anim-color/anim-color.js", 37);
+return val;
+ }
+};
+
+_yuitest_coverline("build/anim-color/anim-color.js", 41);
+Y.each(['backgroundColor',
+ 'borderColor',
+ 'borderTopColor',
+ 'borderRightColor',
+ 'borderBottomColor',
+ 'borderLeftColor'],
+ function(v, i) {
+ _yuitest_coverfunc("build/anim-color/anim-color.js", "(anonymous 2)", 47);
+_yuitest_coverline("build/anim-color/anim-color.js", 48);
+Y.Anim.behaviors[v] = Y.Anim.behaviors.color;
+ }
+);
+
+
+}, '@VERSION@', {"requires": ["anim-base"]});
View
33 build/anim-color/anim-color-debug.js
@@ -1,4 +1,4 @@
-YUI.add('anim-color', function(Y) {
+YUI.add('anim-color', function (Y, NAME) {
/**
* Adds support for color properties in <code>to</code>
@@ -9,20 +9,25 @@ YUI.add('anim-color', function(Y) {
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));
+Y.Anim.getUpdatedColorValue = function(fromColor, toColor, elapsed, duration, fn)
+{
+ fromColor = Y.Color.re_RGB.exec(Y.Color.toRGB(fromColor));
+ toColor = Y.Color.re_RGB.exec(Y.Color.toRGB(toColor));
- if (!from || from.length < 3 || !to || to.length < 3) {
- Y.error('invalid from or to passed to color behavior');
- }
+ if (!fromColor || fromColor.length < 3 || !toColor || toColor.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(', ') + ')');
+ return 'rgb(' + [
+ Math.floor(fn(elapsed, NUM(fromColor[1]), NUM(toColor[1]) - NUM(fromColor[1]), duration)),
+ Math.floor(fn(elapsed, NUM(fromColor[2]), NUM(toColor[2]) - NUM(fromColor[2]), duration)),
+ Math.floor(fn(elapsed, NUM(fromColor[3]), NUM(toColor[3]) - NUM(fromColor[3]), duration))
+ ].join(', ') + ')';
+};
+
+Y.Anim.behaviors.color = {
+ set: function(anim, att, from, to, elapsed, duration, fn) {
+ anim._node.setStyle(att, Y.Anim.getUpdatedColorValue(from, to, elapsed, duration, fn));
},
// TODO: default bgcolor const
@@ -45,4 +50,4 @@ Y.each(['backgroundColor',
);
-}, '@VERSION@' ,{requires:['anim-base']});
+}, '@VERSION@', {"requires": ["anim-base"]});
View
2  build/anim-color/anim-color-min.js
@@ -1 +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"]});
+YUI.add("anim-color",function(e,t){var n=Number;e.Anim.getUpdatedColorValue=function(t,r,i,s,o){return t=e.Color.re_RGB.exec(e.Color.toRGB(t)),r=e.Color.re_RGB.exec(e.Color.toRGB(r)),(!t||t.length<3||!r||r.length<3)&&e.error("invalid from or to passed to color behavior"),"rgb("+[Math.floor(o(i,n(t[1]),n(r[1])-n(t[1]),s)),Math.floor(o(i,n(t[2]),n(r[2])-n(t[2]),s)),Math.floor(o(i,n(t[3]),n(r[3])-n(t[3]),s))].join(", ")+")"},e.Anim.behaviors.color={set:function(t,n,r,i,s,o,u){t._node.setStyle(n,e.Anim.getUpdatedColorValue(r,i,s,o,u))},get:function(e,t){var n=e._node.getComputedStyle(t);return n=n==="transparent"?"rgb(255, 255, 255)":n,n}},e.each(["backgroundColor","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"],function(t,n){e.Anim.behaviors[t]=e.Anim.behaviors.color})},"@VERSION@",{requires:["anim-base"]});
View
33 build/anim-color/anim-color.js
@@ -1,4 +1,4 @@
-YUI.add('anim-color', function(Y) {
+YUI.add('anim-color', function (Y, NAME) {
/**
* Adds support for color properties in <code>to</code>
@@ -9,20 +9,25 @@ YUI.add('anim-color', function(Y) {
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));
+Y.Anim.getUpdatedColorValue = function(fromColor, toColor, elapsed, duration, fn)
+{
+ fromColor = Y.Color.re_RGB.exec(Y.Color.toRGB(fromColor));
+ toColor = Y.Color.re_RGB.exec(Y.Color.toRGB(toColor));
- if (!from || from.length < 3 || !to || to.length < 3) {
- Y.error('invalid from or to passed to color behavior');
- }
+ if (!fromColor || fromColor.length < 3 || !toColor || toColor.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(', ') + ')');
+ return 'rgb(' + [
+ Math.floor(fn(elapsed, NUM(fromColor[1]), NUM(toColor[1]) - NUM(fromColor[1]), duration)),
+ Math.floor(fn(elapsed, NUM(fromColor[2]), NUM(toColor[2]) - NUM(fromColor[2]), duration)),
+ Math.floor(fn(elapsed, NUM(fromColor[3]), NUM(toColor[3]) - NUM(fromColor[3]), duration))
+ ].join(', ') + ')';
+};
+
+Y.Anim.behaviors.color = {
+ set: function(anim, att, from, to, elapsed, duration, fn) {
+ anim._node.setStyle(att, Y.Anim.getUpdatedColorValue(from, to, elapsed, duration, fn));
},
// TODO: default bgcolor const
@@ -45,4 +50,4 @@ Y.each(['backgroundColor',
);
-}, '@VERSION@' ,{requires:['anim-base']});
+}, '@VERSION@', {"requires": ["anim-base"]});
View
112 build/anim-curve/anim-curve-coverage.js
@@ -0,0 +1,112 @@
+if (typeof _yuitest_coverage == "undefined"){
+ _yuitest_coverage = {};
+ _yuitest_coverline = function(src, line){
+ var coverage = _yuitest_coverage[src];
+ if (!coverage.lines[line]){
+ coverage.calledLines++;
+ }
+ coverage.lines[line]++;
+ };
+ _yuitest_coverfunc = function(src, name, line){
+ var coverage = _yuitest_coverage[src],
+ funcId = name + ":" + line;
+ if (!coverage.functions[funcId]){
+ coverage.calledFunctions++;
+ }
+ coverage.functions[funcId]++;
+ };
+}
+_yuitest_coverage["build/anim-curve/anim-curve.js"] = {
+ lines: {},
+ functions: {},
+ coveredLines: 0,
+ calledLines: 0,
+ coveredFunctions: 0,
+ calledFunctions: 0,
+ path: "build/anim-curve/anim-curve.js",
+ code: []
+};
+_yuitest_coverage["build/anim-curve/anim-curve.js"].code=["YUI.add('anim-curve', function (Y, NAME) {","","/**"," * 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\"]});"];
+_yuitest_coverage["build/anim-curve/anim-curve.js"].lines = {"1":0,"10":0,"12":0,"13":0,"14":0,"15":0,"16":0,"20":0,"37":0,"38":0,"39":0,"41":0,"42":0,"45":0,"46":0,"47":0,"48":0,"52":0};
+_yuitest_coverage["build/anim-curve/anim-curve.js"].functions = {"set:11":0,"get:19":0,"getBezier:37":0,"(anonymous 1):1":0};
+_yuitest_coverage["build/anim-curve/anim-curve.js"].coveredLines = 18;
+_yuitest_coverage["build/anim-curve/anim-curve.js"].coveredFunctions = 4;
+_yuitest_coverline("build/anim-curve/anim-curve.js", 1);
+YUI.add('anim-curve', function (Y, NAME) {
+
+/**
+ * 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
+ */
+
+_yuitest_coverfunc("build/anim-curve/anim-curve.js", "(anonymous 1)", 1);
+_yuitest_coverline("build/anim-curve/anim-curve.js", 10);
+Y.Anim.behaviors.curve = {
+ set: function(anim, att, from, to, elapsed, duration, fn) {
+ _yuitest_coverfunc("build/anim-curve/anim-curve.js", "set", 11);
+_yuitest_coverline("build/anim-curve/anim-curve.js", 12);
+from = from.slice.call(from);
+ _yuitest_coverline("build/anim-curve/anim-curve.js", 13);
+to = to.slice.call(to);
+ _yuitest_coverline("build/anim-curve/anim-curve.js", 14);
+var t = fn(elapsed, 0, 100, duration) / 100;
+ _yuitest_coverline("build/anim-curve/anim-curve.js", 15);
+to.unshift(from);
+ _yuitest_coverline("build/anim-curve/anim-curve.js", 16);
+anim._node.setXY(Y.Anim.getBezier(to, t));
+ },
+
+ get: function(anim, att) {
+ _yuitest_coverfunc("build/anim-curve/anim-curve.js", "get", 19);
+_yuitest_coverline("build/anim-curve/anim-curve.js", 20);
+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
+ */
+_yuitest_coverline("build/anim-curve/anim-curve.js", 37);
+Y.Anim.getBezier = function(points, t) {
+ _yuitest_coverfunc("build/anim-curve/anim-curve.js", "getBezier", 37);
+_yuitest_coverline("build/anim-curve/anim-curve.js", 38);
+var n = points.length;
+ _yuitest_coverline("build/anim-curve/anim-curve.js", 39);
+var tmp = [];
+
+ _yuitest_coverline("build/anim-curve/anim-curve.js", 41);
+for (var i = 0; i < n; ++i){
+ _yuitest_coverline("build/anim-curve/anim-curve.js", 42);
+tmp[i] = [points[i][0], points[i][1]]; // save input
+ }
+
+ _yuitest_coverline("build/anim-curve/anim-curve.js", 45);
+for (var j = 1; j < n; ++j) {
+ _yuitest_coverline("build/anim-curve/anim-curve.js", 46);
+for (i = 0; i < n - j; ++i) {
+ _yuitest_coverline("build/anim-curve/anim-curve.js", 47);
+tmp[i][0] = (1 - t) * tmp[i][0] + t * tmp[parseInt(i + 1, 10)][0];
+ _yuitest_coverline("build/anim-curve/anim-curve.js", 48);
+tmp[i][1] = (1 - t) * tmp[i][1] + t * tmp[parseInt(i + 1, 10)][1];
+ }
+ }
+
+ _yuitest_coverline("build/anim-curve/anim-curve.js", 52);
+return [ tmp[0][0], tmp[0][1] ];
+
+};
+
+
+}, '@VERSION@', {"requires": ["anim-xy"]});
View
4 build/anim-curve/anim-curve-debug.js
@@ -1,4 +1,4 @@
-YUI.add('anim-curve', function(Y) {
+YUI.add('anim-curve', function (Y, NAME) {
/**
* Adds support for the <code>curve</code> property for the <code>to</code>
@@ -54,4 +54,4 @@ Y.Anim.getBezier = function(points, t) {
};
-}, '@VERSION@' ,{requires:['anim-xy']});
+}, '@VERSION@', {"requires": ["anim-xy"]});
View
2  build/anim-curve/anim-curve-min.js
@@ -1 +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"]});
+YUI.add("anim-curve",function(e,t){e.Anim.behaviors.curve={set:function(t,n,r,i,s,o,u){r=r.slice.call(r),i=i.slice.call(i);var a=u(s,0,100,o)/100;i.unshift(r),t._node.setXY(e.Anim.getBezier(i,a))},get:function(e,t){return e._node.getXY()}},e.Anim.getBezier=function(e,t){var n=e.length,r=[];for(var i=0;i<n;++i)r[i]=[e[i][0],e[i][1]];for(var s=1;s<n;++s)for(i=0;i<n-s;++i)r[i][0]=(1-t)*r[i][0]+t*r[parseInt(i+1,10)][0],r[i][1]=(1-t)*r[i][1]+t*r[parseInt(i+1,10)][1];return[r[0][0],r[0][1]]}},"@VERSION@",{requires:[