Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'master' of github.com:yui/yui3

  • Loading branch information...
commit 0ad24062df329219badcb149794ddab947ced2d7 2 parents 446e875 + 85affcc
@msweeney authored
Showing with 2,381 additions and 2,079 deletions.
  1. +2 −1  .travis.yml
  2. +1 −0  README.md
  3. +128 −128 build/anim-base/anim-base-coverage.js
  4. +37 −36 build/anim-base/anim-base-debug.js
  5. +1 −1  build/anim-base/anim-base-min.js
  6. +37 −36 build/anim-base/anim-base.js
  7. +6 −6 build/anim-color/anim-color-coverage.js
  8. +5 −5 build/anim-color/anim-color-debug.js
  9. +1 −1  build/anim-color/anim-color-min.js
  10. +5 −5 build/anim-color/anim-color.js
  11. +23 −22 build/anim-curve/anim-curve-coverage.js
  12. +13 −11 build/anim-curve/anim-curve-debug.js
  13. +1 −1  build/anim-curve/anim-curve-min.js
  14. +13 −11 build/anim-curve/anim-curve.js
  15. +88 −92 build/anim-shape/anim-shape-coverage.js
  16. +16 −20 build/anim-shape/anim-shape-debug.js
  17. +1 −1  build/anim-shape/anim-shape-min.js
  18. +16 −20 build/anim-shape/anim-shape.js
  19. +2 −2 build/calendar-base/calendar-base-coverage.js
  20. +1 −1  build/calendar-base/calendar-base-debug.js
  21. +1 −1  build/calendar-base/calendar-base-min.js
  22. +1 −1  build/calendar-base/calendar-base.js
  23. +3 −2 build/calendarnavigator/calendarnavigator-coverage.js
  24. +2 −1  build/calendarnavigator/calendarnavigator-debug.js
  25. +1 −1  build/calendarnavigator/calendarnavigator-min.js
  26. +2 −1  build/calendarnavigator/calendarnavigator.js
  27. +18 −35 build/datatype-date-parse/datatype-date-parse-coverage.js
  28. +7 −20 build/datatype-date-parse/datatype-date-parse-debug.js
  29. +1 −1  build/datatype-date-parse/datatype-date-parse-min.js
  30. +6 −19 build/datatype-date-parse/datatype-date-parse.js
  31. +117 −109 build/event-focus/event-focus-coverage.js
  32. +16 −10 build/event-focus/event-focus-debug.js
  33. +1 −1  build/event-focus/event-focus-min.js
  34. +16 −10 build/event-focus/event-focus.js
  35. +293 −287 build/event-simulate/event-simulate-coverage.js
  36. +19 −12 build/event-simulate/event-simulate-debug.js
  37. +1 −1  build/event-simulate/event-simulate-min.js
  38. +19 −12 build/event-simulate/event-simulate.js
  39. +60 −59 build/event-tap/event-tap-coverage.js
  40. +5 −4 build/event-tap/event-tap-debug.js
  41. +1 −1  build/event-tap/event-tap-min.js
  42. +5 −4 build/event-tap/event-tap.js
  43. +17 −11 build/event-touch/event-touch-coverage.js
  44. +3 −0  build/event-touch/event-touch-debug.js
  45. +1 −1  build/event-touch/event-touch-min.js
  46. +3 −0  build/event-touch/event-touch.js
  47. +2 −2 build/loader-base/loader-base-coverage.js
  48. +1 −1  build/loader-base/loader-base-debug.js
  49. +1 −1  build/loader-base/loader-base-min.js
  50. +1 −1  build/loader-base/loader-base.js
  51. +1 −1  build/loader/loader-debug.js
  52. +1 −1  build/loader/loader-min.js
  53. +1 −1  build/loader/loader.js
  54. +85 −72 build/pjax-base/pjax-base-coverage.js
  55. +14 −6 build/pjax-base/pjax-base-debug.js
  56. +1 −1  build/pjax-base/pjax-base-min.js
  57. +14 −6 build/pjax-base/pjax-base.js
  58. +3 −3 build/pjax-content/pjax-content-coverage.js
  59. +2 −2 build/pjax-content/pjax-content-debug.js
  60. +1 −1  build/pjax-content/pjax-content-min.js
  61. +2 −2 build/pjax-content/pjax-content.js
  62. +319 −306 build/router/router-coverage.js
  63. +20 −10 build/router/router-debug.js
  64. +1 −1  build/router/router-min.js
  65. +20 −10 build/router/router.js
  66. +24 −21 build/simpleyui/simpleyui-debug.js
  67. +24 −21 build/simpleyui/simpleyui.js
  68. +2 −2 build/uploader-flash/uploader-flash-coverage.js
  69. +1 −1  build/uploader-flash/uploader-flash-debug.js
  70. +1 −1  build/uploader-flash/uploader-flash-min.js
  71. +1 −1  build/uploader-flash/uploader-flash.js
  72. +152 −149 build/uploader-html5/uploader-html5-coverage.js
  73. +43 −41 build/uploader-html5/uploader-html5-debug.js
  74. +1 −1  build/uploader-html5/uploader-html5-min.js
  75. +43 −41 build/uploader-html5/uploader-html5.js
  76. +3 −2 build/uploader-queue/uploader-queue-coverage.js
  77. +2 −1  build/uploader-queue/uploader-queue-debug.js
  78. +1 −1  build/uploader-queue/uploader-queue-min.js
  79. +2 −1  build/uploader-queue/uploader-queue.js
  80. +15 −2 build/yui-nodejs/yui-nodejs-coverage.js
  81. +28 −3 build/yui-nodejs/yui-nodejs-debug.js
  82. +1 −1  build/yui-nodejs/yui-nodejs-min.js
  83. +28 −3 build/yui-nodejs/yui-nodejs.js
  84. +14 −2 build/yui/yui-coverage.js
  85. +27 −3 build/yui/yui-debug.js
  86. +1 −1  build/yui/yui-min.js
  87. +27 −3 build/yui/yui.js
  88. +5 −5 src/anim/js/anim-color.js
  89. +13 −11 src/anim/js/anim-curve.js
  90. +48 −33 src/anim/js/anim-easing.js
  91. +1 −1  src/anim/js/anim-scroll.js
  92. +16 −20 src/anim/js/anim-shape.js
  93. +1 −1  src/anim/js/anim-xy.js
  94. +37 −36 src/anim/js/anim.js
  95. +10 −10 src/anim/meta/anim.json
  96. +8 −0 src/app/HISTORY.md
  97. +20 −10 src/app/js/router.js
  98. +15 −6 src/app/tests/unit/assets/app-content-test.js
  99. +47 −8 src/app/tests/unit/assets/router-test.js
  100. +1 −1  src/calendar/js/calendar-base.js
  101. +2 −2 src/calendar/js/calendarnavigator.js
  102. +8 −2 src/common/travis/before.sh
  103. +12 −12 src/common/travis/install.sh
  104. +5 −4 src/common/travis/test.sh
  105. +7 −20 src/date/js/date-parse.js
  106. +24 −24 src/date/tests/unit/assets/date-tests.js
  107. +1 −1  src/date/tests/unit/date.html
  108. +19 −12 src/event-simulate/js/event-simulate.js
  109. +3 −0  src/event/js/event-facade-dom-touch.js
  110. +5 −4 src/event/js/tap.js
  111. +17 −37 src/event/tests/unit/assets/event-tap-tests.js
  112. +1 −0  src/get/tests/unit/coverage.html
  113. +1 −1  src/loader/build.json
  114. +8 −0 src/pjax/HISTORY.md
  115. +14 −6 src/pjax/js/pjax-base.js
  116. +2 −2 src/pjax/js/pjax-content.js
  117. +19 −1 src/pjax/tests/unit/assets/pjax-test.js
  118. +6 −20 src/simpleyui/js/concat.js
  119. +1 −1  src/uploader/js/uploader-flash.js
  120. +43 −41 src/uploader/js/uploader-html5.js
  121. +2 −2 src/uploader/js/uploader-queue.js
  122. +12 −11 src/uploader/tests/unit/uploaderhtml5.html
View
3  .travis.yml
@@ -7,7 +7,8 @@ branches:
only:
- master
- 3.x
- - ie10
+ - dev-master
+ - dev-3.x
before_install:
- ./src/common/travis/before.sh
install:
View
1  README.md
@@ -74,3 +74,4 @@ Shifter also allows you to rebuild the entire YUI src tree:
cd yui3/src && shifter --walk
+
View
256 build/anim-base/anim-base-coverage.js
@@ -26,10 +26,10 @@ _yuitest_coverage["build/anim-base/anim-base.js"] = {
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"].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,"," i;"," for (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,"," anim;"," for (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);",""," 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),"," 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',"," position;",""," if (val === 'auto') {"," 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,"357":0,"358":0,"359":0,"369":0,"370":0,"371":0,"372":0,"376":0,"384":0,"385":0,"386":0,"387":0,"390":0,"393":0,"394":0,"395":0,"399":0,"400":0,"401":0,"410":0,"411":0,"413":0,"414":0,"415":0,"416":0,"420":0,"421":0,"425":0,"427":0,"434":0,"435":0,"436":0,"437":0,"439":0,"450":0,"451":0,"453":0,"463":0,"464":0,"466":0,"472":0,"473":0,"474":0,"475":0,"477":0,"478":0,"480":0,"484":0,"485":0,"486":0,"494":0,"498":0,"499":0,"500":0,"501":0,"509":0,"513":0,"514":0,"515":0,"518":0,"519":0,"520":0,"522":0,"523":0,"527":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,"630":0,"631":0,"632":0,"634":0,"635":0,"638":0,"639":0,"640":0,"643":0,"651":0,"657":0,"663":0,"664":0,"665":0,"666":0,"667":0,"669":0,"673":0,"677":0,"681":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:369":0,"stop:384":0,"_startTimer:393":0,"_stopTimer:399":0,"_runFrame:410":0,"run:433":0,"pause:449":0,"stop:462":0,"_start:471":0,"_pause:483":0,"_resume:497":0,"_end:512":0,"_runFrame:526":0,"_runAttrs:542":0,"_lastFrame:578":0,"(anonymous 2):614":0,"_initAnimAttr:603":0,"_getOffset:656":0,"destructor:676":0,"(anonymous 1):1":0};
+_yuitest_coverage["build/anim-base/anim-base.js"].coveredLines = 180;
_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) {
@@ -135,7 +135,7 @@ return c * t / d + b; // linear easing
};
/**
- * Time in milliseconds passed to setInterval for frame processing
+ * Time in milliseconds passed to setInterval for frame processing
*
* @property intervalTime
* @default 20
@@ -262,7 +262,7 @@ Y.Anim.ATTRS = {
_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) {
+if (typeof node === 'string' || node.nodeType) {
_yuitest_coverline("build/anim-base/anim-base.js", 179);
node = Y.one(node);
}
@@ -288,7 +288,7 @@ return node;
},
/**
- * The method that will provide values to the attribute(s) during the animation.
+ * The method that will provide values to the attribute(s) during the animation.
* Defaults to "Easing.easeNone".
* @attribute easing
* @type Function
@@ -344,7 +344,7 @@ return Y.Easing[val];
* Date stamp for the first frame of the animation.
* @attribute startTime
* @type Int
- * @default 0
+ * @default 0
* @readOnly
*/
startTime: {
@@ -356,7 +356,7 @@ return Y.Easing[val];
* Current time the animation has been running.
* @attribute elapsedTime
* @type Int
- * @default 0
+ * @default 0
* @readOnly
*/
elapsedTime: {
@@ -366,9 +366,9 @@ return Y.Easing[val];
/**
* Whether or not the animation is currently running.
- * @attribute running
+ * @attribute running
* @type Boolean
- * @default false
+ * @default false
* @readOnly
*/
running: {
@@ -382,10 +382,10 @@ return !!_running[Y.stamp(this)];
},
/**
- * The number of times the animation should run
+ * The number of times the animation should run
* @attribute iterations
* @type Int
- * @default 1
+ * @default 1
*/
iterations: {
value: 1
@@ -393,7 +393,7 @@ return !!_running[Y.stamp(this)];
/**
* The number of iterations that have occurred.
- * Resets when an animation ends (reaches iteration count or stop() called).
+ * Resets when an animation ends (reaches iteration count or stop() called).
* @attribute iterationCount
* @type Int
* @default 0
@@ -405,7 +405,7 @@ return !!_running[Y.stamp(this)];
},
/**
- * How iterations of the animation should behave.
+ * 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.
*
@@ -419,9 +419,9 @@ return !!_running[Y.stamp(this)];
/**
* Whether or not the animation is currently paused.
- * @attribute paused
+ * @attribute paused
* @type Boolean
- * @default false
+ * @default false
* @readOnly
*/
paused: {
@@ -433,7 +433,7 @@ return !!_running[Y.stamp(this)];
* If true, animation begins from last frame
* @attribute reverse
* @type Boolean
- * @default false
+ * @default false
*/
reverse: {
value: false
@@ -446,17 +446,18 @@ return !!_running[Y.stamp(this)];
* 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);
+var instances = Y.Anim._instances,
+ i;
+ _yuitest_coverline("build/anim-base/anim-base.js", 357);
+for (i in instances) {
+ _yuitest_coverline("build/anim-base/anim-base.js", 358);
if (instances[i].run) {
- _yuitest_coverline("build/anim-base/anim-base.js", 358);
+ _yuitest_coverline("build/anim-base/anim-base.js", 359);
instances[i].run();
}
}
@@ -466,20 +467,20 @@ instances[i].run();
* Pauses all animation instances.
* @method pause
* @static
- */
- _yuitest_coverline("build/anim-base/anim-base.js", 368);
+ */
+ _yuitest_coverline("build/anim-base/anim-base.js", 369);
Y.Anim.pause = function() {
- _yuitest_coverfunc("build/anim-base/anim-base.js", "pause", 368);
-_yuitest_coverline("build/anim-base/anim-base.js", 369);
+ _yuitest_coverfunc("build/anim-base/anim-base.js", "pause", 369);
+_yuitest_coverline("build/anim-base/anim-base.js", 370);
for (var i in _running) { // stop timer if nothing running
- _yuitest_coverline("build/anim-base/anim-base.js", 370);
+ _yuitest_coverline("build/anim-base/anim-base.js", 371);
if (_running[i].pause) {
- _yuitest_coverline("build/anim-base/anim-base.js", 371);
+ _yuitest_coverline("build/anim-base/anim-base.js", 372);
_running[i].pause();
}
}
- _yuitest_coverline("build/anim-base/anim-base.js", 375);
+ _yuitest_coverline("build/anim-base/anim-base.js", 376);
Y.Anim._stopTimer();
};
@@ -487,38 +488,38 @@ Y.Anim._stopTimer();
* Stops all animation instances.
* @method stop
* @static
- */
- _yuitest_coverline("build/anim-base/anim-base.js", 383);
+ */
+ _yuitest_coverline("build/anim-base/anim-base.js", 384);
Y.Anim.stop = function() {
- _yuitest_coverfunc("build/anim-base/anim-base.js", "stop", 383);
-_yuitest_coverline("build/anim-base/anim-base.js", 384);
+ _yuitest_coverfunc("build/anim-base/anim-base.js", "stop", 384);
+_yuitest_coverline("build/anim-base/anim-base.js", 385);
for (var i in _running) { // stop timer if nothing running
- _yuitest_coverline("build/anim-base/anim-base.js", 385);
+ _yuitest_coverline("build/anim-base/anim-base.js", 386);
if (_running[i].stop) {
- _yuitest_coverline("build/anim-base/anim-base.js", 386);
+ _yuitest_coverline("build/anim-base/anim-base.js", 387);
_running[i].stop();
}
}
- _yuitest_coverline("build/anim-base/anim-base.js", 389);
+ _yuitest_coverline("build/anim-base/anim-base.js", 390);
Y.Anim._stopTimer();
};
-
- _yuitest_coverline("build/anim-base/anim-base.js", 392);
+
+ _yuitest_coverline("build/anim-base/anim-base.js", 393);
Y.Anim._startTimer = function() {
- _yuitest_coverfunc("build/anim-base/anim-base.js", "_startTimer", 392);
-_yuitest_coverline("build/anim-base/anim-base.js", 393);
+ _yuitest_coverfunc("build/anim-base/anim-base.js", "_startTimer", 393);
+_yuitest_coverline("build/anim-base/anim-base.js", 394);
if (!_timer) {
- _yuitest_coverline("build/anim-base/anim-base.js", 394);
+ _yuitest_coverline("build/anim-base/anim-base.js", 395);
_timer = setInterval(Y.Anim._runFrame, Y.Anim._intervalTime);
}
};
- _yuitest_coverline("build/anim-base/anim-base.js", 398);
+ _yuitest_coverline("build/anim-base/anim-base.js", 399);
Y.Anim._stopTimer = function() {
- _yuitest_coverfunc("build/anim-base/anim-base.js", "_stopTimer", 398);
-_yuitest_coverline("build/anim-base/anim-base.js", 399);
+ _yuitest_coverfunc("build/anim-base/anim-base.js", "_stopTimer", 399);
+_yuitest_coverline("build/anim-base/anim-base.js", 400);
clearInterval(_timer);
- _yuitest_coverline("build/anim-base/anim-base.js", 400);
+ _yuitest_coverline("build/anim-base/anim-base.js", 401);
_timer = 0;
};
@@ -527,52 +528,53 @@ _timer = 0;
* @method _runFrame
* @private
* @static
- */
- _yuitest_coverline("build/anim-base/anim-base.js", 409);
+ */
+ _yuitest_coverline("build/anim-base/anim-base.js", 410);
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);
+ _yuitest_coverfunc("build/anim-base/anim-base.js", "_runFrame", 410);
+_yuitest_coverline("build/anim-base/anim-base.js", 411);
+var done = true,
+ anim;
+ _yuitest_coverline("build/anim-base/anim-base.js", 413);
+for (anim in _running) {
+ _yuitest_coverline("build/anim-base/anim-base.js", 414);
if (_running[anim]._runFrame) {
- _yuitest_coverline("build/anim-base/anim-base.js", 413);
+ _yuitest_coverline("build/anim-base/anim-base.js", 415);
done = false;
- _yuitest_coverline("build/anim-base/anim-base.js", 414);
+ _yuitest_coverline("build/anim-base/anim-base.js", 416);
_running[anim]._runFrame();
}
}
- _yuitest_coverline("build/anim-base/anim-base.js", 418);
+ _yuitest_coverline("build/anim-base/anim-base.js", 420);
if (done) {
- _yuitest_coverline("build/anim-base/anim-base.js", 419);
+ _yuitest_coverline("build/anim-base/anim-base.js", 421);
Y.Anim._stopTimer();
}
};
- _yuitest_coverline("build/anim-base/anim-base.js", 423);
+ _yuitest_coverline("build/anim-base/anim-base.js", 425);
Y.Anim.RE_UNITS = /^(-?\d*\.?\d*){1}(em|ex|px|in|cm|mm|pt|pc|%)*$/;
- _yuitest_coverline("build/anim-base/anim-base.js", 425);
+ _yuitest_coverline("build/anim-base/anim-base.js", 427);
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);
+ _yuitest_coverfunc("build/anim-base/anim-base.js", "run", 433);
+_yuitest_coverline("build/anim-base/anim-base.js", 434);
if (this.get(PAUSED)) {
- _yuitest_coverline("build/anim-base/anim-base.js", 433);
+ _yuitest_coverline("build/anim-base/anim-base.js", 435);
this._resume();
- } else {_yuitest_coverline("build/anim-base/anim-base.js", 434);
+ } else {_yuitest_coverline("build/anim-base/anim-base.js", 436);
if (!this.get(RUNNING)) {
- _yuitest_coverline("build/anim-base/anim-base.js", 435);
+ _yuitest_coverline("build/anim-base/anim-base.js", 437);
this._start();
}}
- _yuitest_coverline("build/anim-base/anim-base.js", 437);
+ _yuitest_coverline("build/anim-base/anim-base.js", 439);
return this;
},
@@ -582,15 +584,15 @@ return this;
* 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);
+ _yuitest_coverfunc("build/anim-base/anim-base.js", "pause", 449);
+_yuitest_coverline("build/anim-base/anim-base.js", 450);
if (this.get(RUNNING)) {
- _yuitest_coverline("build/anim-base/anim-base.js", 449);
+ _yuitest_coverline("build/anim-base/anim-base.js", 451);
this._pause();
}
- _yuitest_coverline("build/anim-base/anim-base.js", 451);
+ _yuitest_coverline("build/anim-base/anim-base.js", 453);
return this;
},
@@ -599,47 +601,47 @@ return this;
* @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);
+ _yuitest_coverfunc("build/anim-base/anim-base.js", "stop", 462);
+_yuitest_coverline("build/anim-base/anim-base.js", 463);
if (this.get(RUNNING) || this.get(PAUSED)) {
- _yuitest_coverline("build/anim-base/anim-base.js", 462);
+ _yuitest_coverline("build/anim-base/anim-base.js", 464);
this._end(finish);
}
- _yuitest_coverline("build/anim-base/anim-base.js", 464);
+ _yuitest_coverline("build/anim-base/anim-base.js", 466);
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);
+ _yuitest_coverfunc("build/anim-base/anim-base.js", "_start", 471);
+_yuitest_coverline("build/anim-base/anim-base.js", 472);
this._set(START_TIME, new Date() - this.get(ELAPSED_TIME));
- _yuitest_coverline("build/anim-base/anim-base.js", 471);
+ _yuitest_coverline("build/anim-base/anim-base.js", 473);
this._actualFrames = 0;
- _yuitest_coverline("build/anim-base/anim-base.js", 472);
+ _yuitest_coverline("build/anim-base/anim-base.js", 474);
if (!this.get(PAUSED)) {
- _yuitest_coverline("build/anim-base/anim-base.js", 473);
+ _yuitest_coverline("build/anim-base/anim-base.js", 475);
this._initAnimAttr();
}
- _yuitest_coverline("build/anim-base/anim-base.js", 475);
+ _yuitest_coverline("build/anim-base/anim-base.js", 477);
_running[Y.stamp(this)] = this;
- _yuitest_coverline("build/anim-base/anim-base.js", 476);
+ _yuitest_coverline("build/anim-base/anim-base.js", 478);
Y.Anim._startTimer();
- _yuitest_coverline("build/anim-base/anim-base.js", 478);
+ _yuitest_coverline("build/anim-base/anim-base.js", 480);
this.fire(START);
},
_pause: function() {
- _yuitest_coverfunc("build/anim-base/anim-base.js", "_pause", 481);
-_yuitest_coverline("build/anim-base/anim-base.js", 482);
+ _yuitest_coverfunc("build/anim-base/anim-base.js", "_pause", 483);
+_yuitest_coverline("build/anim-base/anim-base.js", 484);
this._set(START_TIME, null);
- _yuitest_coverline("build/anim-base/anim-base.js", 483);
+ _yuitest_coverline("build/anim-base/anim-base.js", 485);
this._set(PAUSED, true);
- _yuitest_coverline("build/anim-base/anim-base.js", 484);
+ _yuitest_coverline("build/anim-base/anim-base.js", 486);
delete _running[Y.stamp(this)];
/**
@@ -648,19 +650,19 @@ delete _running[Y.stamp(this)];
* @param {Event} ev The pause event.
* @type Event.Custom
*/
- _yuitest_coverline("build/anim-base/anim-base.js", 492);
+ _yuitest_coverline("build/anim-base/anim-base.js", 494);
this.fire('pause');
},
_resume: function() {
- _yuitest_coverfunc("build/anim-base/anim-base.js", "_resume", 495);
-_yuitest_coverline("build/anim-base/anim-base.js", 496);
+ _yuitest_coverfunc("build/anim-base/anim-base.js", "_resume", 497);
+_yuitest_coverline("build/anim-base/anim-base.js", 498);
this._set(PAUSED, false);
- _yuitest_coverline("build/anim-base/anim-base.js", 497);
+ _yuitest_coverline("build/anim-base/anim-base.js", 499);
_running[Y.stamp(this)] = this;
- _yuitest_coverline("build/anim-base/anim-base.js", 498);
+ _yuitest_coverline("build/anim-base/anim-base.js", 500);
this._set(START_TIME, new Date() - this.get(ELAPSED_TIME));
- _yuitest_coverline("build/anim-base/anim-base.js", 499);
+ _yuitest_coverline("build/anim-base/anim-base.js", 501);
Y.Anim._startTimer();
/**
@@ -669,43 +671,41 @@ Y.Anim._startTimer();
* @param {Event} ev The pause event.
* @type Event.Custom
*/
- _yuitest_coverline("build/anim-base/anim-base.js", 507);
+ _yuitest_coverline("build/anim-base/anim-base.js", 509);
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);
+ _yuitest_coverfunc("build/anim-base/anim-base.js", "_end", 512);
+_yuitest_coverline("build/anim-base/anim-base.js", 513);
var duration = this.get('duration') * 1000;
- _yuitest_coverline("build/anim-base/anim-base.js", 512);
+ _yuitest_coverline("build/anim-base/anim-base.js", 514);
if (finish) { // jump to last frame
- _yuitest_coverline("build/anim-base/anim-base.js", 513);
+ _yuitest_coverline("build/anim-base/anim-base.js", 515);
this._runAttrs(duration, duration, this.get(REVERSE));
}
- _yuitest_coverline("build/anim-base/anim-base.js", 516);
+ _yuitest_coverline("build/anim-base/anim-base.js", 518);
this._set(START_TIME, null);
- _yuitest_coverline("build/anim-base/anim-base.js", 517);
+ _yuitest_coverline("build/anim-base/anim-base.js", 519);
this._set(ELAPSED_TIME, 0);
- _yuitest_coverline("build/anim-base/anim-base.js", 518);
+ _yuitest_coverline("build/anim-base/anim-base.js", 520);
this._set(PAUSED, false);
- _yuitest_coverline("build/anim-base/anim-base.js", 520);
+ _yuitest_coverline("build/anim-base/anim-base.js", 522);
delete _running[Y.stamp(this)];
- _yuitest_coverline("build/anim-base/anim-base.js", 521);
+ _yuitest_coverline("build/anim-base/anim-base.js", 523);
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);
+ _yuitest_coverfunc("build/anim-base/anim-base.js", "_runFrame", 526);
+_yuitest_coverline("build/anim-base/anim-base.js", 527);
var d = this._runtimeAttr.duration,
t = new Date() - this.get(START_TIME),
reverse = this.get(REVERSE),
- done = (t >= d),
- attribute,
- setter;
-
+ done = (t >= d);
+
_yuitest_coverline("build/anim-base/anim-base.js", 532);
this._runAttrs(t, d, reverse);
_yuitest_coverline("build/anim-base/anim-base.js", 533);
@@ -761,10 +761,10 @@ setter = (i in customAttr && 'set' in customAttr[i]) ?
_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);
+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);
+setter(this, i, attribute.from, attribute.to, lastFrame, d, easing, attribute.unit);
}
}
}
@@ -844,9 +844,8 @@ 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);
+var mFrom = Y.Anim.RE_UNITS.exec(begin),
+ mTo = Y.Anim.RE_UNITS.exec(val);
_yuitest_coverline("build/anim-base/anim-base.js", 630);
begin = mFrom ? mFrom[1] : begin;
@@ -890,36 +889,37 @@ _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';
+ set = (attr === 'left') ? 'setX': 'setY',
+ position;
- _yuitest_coverline("build/anim-base/anim-base.js", 662);
+ _yuitest_coverline("build/anim-base/anim-base.js", 663);
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);
+position = node.getStyle('position');
+ _yuitest_coverline("build/anim-base/anim-base.js", 665);
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);
+val = node[get]();
+ _yuitest_coverline("build/anim-base/anim-base.js", 667);
node[set](val);
} else {
- _yuitest_coverline("build/anim-base/anim-base.js", 668);
+ _yuitest_coverline("build/anim-base/anim-base.js", 669);
val = 0;
}
}
- _yuitest_coverline("build/anim-base/anim-base.js", 672);
+ _yuitest_coverline("build/anim-base/anim-base.js", 673);
return val;
},
destructor: function() {
- _yuitest_coverfunc("build/anim-base/anim-base.js", "destructor", 675);
-_yuitest_coverline("build/anim-base/anim-base.js", 676);
+ _yuitest_coverfunc("build/anim-base/anim-base.js", "destructor", 676);
+_yuitest_coverline("build/anim-base/anim-base.js", 677);
delete Y.Anim._instances[Y.stamp(this)];
}
};
- _yuitest_coverline("build/anim-base/anim-base.js", 680);
+ _yuitest_coverline("build/anim-base/anim-base.js", 681);
Y.extend(Y.Anim, Y.Base, proto);
View
73 build/anim-base/anim-base-debug.js
@@ -87,7 +87,7 @@ YUI.add('anim-base', function (Y, NAME) {
};
/**
- * Time in milliseconds passed to setInterval for frame processing
+ * Time in milliseconds passed to setInterval for frame processing
*
* @property intervalTime
* @default 20
@@ -175,7 +175,7 @@ YUI.add('anim-base', function (Y, NAME) {
node: {
setter: function(node) {
if (node) {
- if (typeof node == 'string' || node.nodeType) {
+ if (typeof node === 'string' || node.nodeType) {
node = Y.one(node);
}
}
@@ -198,7 +198,7 @@ YUI.add('anim-base', function (Y, NAME) {
},
/**
- * The method that will provide values to the attribute(s) during the animation.
+ * The method that will provide values to the attribute(s) during the animation.
* Defaults to "Easing.easeNone".
* @attribute easing
* @type Function
@@ -251,7 +251,7 @@ YUI.add('anim-base', function (Y, NAME) {
* Date stamp for the first frame of the animation.
* @attribute startTime
* @type Int
- * @default 0
+ * @default 0
* @readOnly
*/
startTime: {
@@ -263,7 +263,7 @@ YUI.add('anim-base', function (Y, NAME) {
* Current time the animation has been running.
* @attribute elapsedTime
* @type Int
- * @default 0
+ * @default 0
* @readOnly
*/
elapsedTime: {
@@ -273,9 +273,9 @@ YUI.add('anim-base', function (Y, NAME) {
/**
* Whether or not the animation is currently running.
- * @attribute running
+ * @attribute running
* @type Boolean
- * @default false
+ * @default false
* @readOnly
*/
running: {
@@ -287,10 +287,10 @@ YUI.add('anim-base', function (Y, NAME) {
},
/**
- * The number of times the animation should run
+ * The number of times the animation should run
* @attribute iterations
* @type Int
- * @default 1
+ * @default 1
*/
iterations: {
value: 1
@@ -298,7 +298,7 @@ YUI.add('anim-base', function (Y, NAME) {
/**
* The number of iterations that have occurred.
- * Resets when an animation ends (reaches iteration count or stop() called).
+ * Resets when an animation ends (reaches iteration count or stop() called).
* @attribute iterationCount
* @type Int
* @default 0
@@ -310,7 +310,7 @@ YUI.add('anim-base', function (Y, NAME) {
},
/**
- * How iterations of the animation should behave.
+ * 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.
*
@@ -324,9 +324,9 @@ YUI.add('anim-base', function (Y, NAME) {
/**
* Whether or not the animation is currently paused.
- * @attribute paused
+ * @attribute paused
* @type Boolean
- * @default false
+ * @default false
* @readOnly
*/
paused: {
@@ -338,7 +338,7 @@ YUI.add('anim-base', function (Y, NAME) {
* If true, animation begins from last frame
* @attribute reverse
* @type Boolean
- * @default false
+ * @default false
*/
reverse: {
value: false
@@ -351,10 +351,11 @@ YUI.add('anim-base', function (Y, NAME) {
* Runs all animation instances.
* @method run
* @static
- */
+ */
Y.Anim.run = function() {
- var instances = Y.Anim._instances;
- for (var i in instances) {
+ var instances = Y.Anim._instances,
+ i;
+ for (i in instances) {
if (instances[i].run) {
instances[i].run();
}
@@ -365,7 +366,7 @@ YUI.add('anim-base', function (Y, NAME) {
* 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) {
@@ -380,7 +381,7 @@ YUI.add('anim-base', function (Y, NAME) {
* 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) {
@@ -389,7 +390,7 @@ YUI.add('anim-base', function (Y, NAME) {
}
Y.Anim._stopTimer();
};
-
+
Y.Anim._startTimer = function() {
if (!_timer) {
_timer = setInterval(Y.Anim._runFrame, Y.Anim._intervalTime);
@@ -406,10 +407,11 @@ YUI.add('anim-base', function (Y, NAME) {
* @method _runFrame
* @private
* @static
- */
+ */
Y.Anim._runFrame = function() {
- var done = true;
- for (var anim in _running) {
+ var done = true,
+ anim;
+ for (anim in _running) {
if (_running[anim]._runFrame) {
done = false;
_running[anim]._runFrame();
@@ -428,7 +430,7 @@ YUI.add('anim-base', function (Y, NAME) {
* Starts or resumes an animation.
* @method run
* @chainable
- */
+ */
run: function() {
if (this.get(PAUSED)) {
this._resume();
@@ -444,7 +446,7 @@ YUI.add('anim-base', function (Y, NAME) {
* Calling run() will continue where it left off.
* @method pause
* @chainable
- */
+ */
pause: function() {
if (this.get(RUNNING)) {
this._pause();
@@ -457,7 +459,7 @@ YUI.add('anim-base', function (Y, NAME) {
* @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);
@@ -526,10 +528,8 @@ YUI.add('anim-base', function (Y, NAME) {
var d = this._runtimeAttr.duration,
t = new Date() - this.get(START_TIME),
reverse = this.get(REVERSE),
- done = (t >= d),
- attribute,
- setter;
-
+ done = (t >= d);
+
this._runAttrs(t, d, reverse);
this._actualFrames += 1;
this._set(ELAPSED_TIME, t);
@@ -566,9 +566,9 @@ YUI.add('anim-base', function (Y, NAME) {
customAttr[i].set : Y.Anim.DEFAULT_SETTER;
if (!done) {
- setter(this, i, attribute.from, attribute.to, t, d, easing, attribute.unit);
+ 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);
+ setter(this, i, attribute.from, attribute.to, lastFrame, d, easing, attribute.unit);
}
}
}
@@ -625,8 +625,8 @@ YUI.add('anim-base', function (Y, NAME) {
begin = begin.call(this, node);
}
- var mFrom = Y.Anim.RE_UNITS.exec(begin);
- var mTo = Y.Anim.RE_UNITS.exec(val);
+ var mFrom = Y.Anim.RE_UNITS.exec(begin),
+ mTo = Y.Anim.RE_UNITS.exec(val);
begin = mFrom ? mFrom[1] : begin;
end = mTo ? mTo[1] : val;
@@ -658,10 +658,11 @@ YUI.add('anim-base', function (Y, NAME) {
var node = this._node,
val = node.getComputedStyle(attr),
get = (attr === 'left') ? 'getX': 'getY',
- set = (attr === 'left') ? 'setX': 'setY';
+ set = (attr === 'left') ? 'setX': 'setY',
+ position;
if (val === 'auto') {
- var position = node.getStyle('position');
+ position = node.getStyle('position');
if (position === 'absolute' || position === 'fixed') {
val = node[get]();
node[set](val);
View
2  build/anim-base/anim-base-min.js
@@ -1 +1 @@
-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"]});
+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,n;for(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,n;for(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;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",s;return n==="auto"&&(s=t.getStyle("position"),s==="absolute"||s==="fixed"?(n=t[r](),t[i](n)):n=0),n},destructor:function(){delete e.Anim._instances[e.stamp(this)]}};e.extend(e.Anim,e.Base,v)},"@VERSION@",{requires:["base-base","node-style"]});
View
73 build/anim-base/anim-base.js
@@ -87,7 +87,7 @@ YUI.add('anim-base', function (Y, NAME) {
};
/**
- * Time in milliseconds passed to setInterval for frame processing
+ * Time in milliseconds passed to setInterval for frame processing
*
* @property intervalTime
* @default 20
@@ -175,7 +175,7 @@ YUI.add('anim-base', function (Y, NAME) {
node: {
setter: function(node) {
if (node) {
- if (typeof node == 'string' || node.nodeType) {
+ if (typeof node === 'string' || node.nodeType) {
node = Y.one(node);
}
}
@@ -197,7 +197,7 @@ YUI.add('anim-base', function (Y, NAME) {
},
/**
- * The method that will provide values to the attribute(s) during the animation.
+ * The method that will provide values to the attribute(s) during the animation.
* Defaults to "Easing.easeNone".
* @attribute easing
* @type Function
@@ -250,7 +250,7 @@ YUI.add('anim-base', function (Y, NAME) {
* Date stamp for the first frame of the animation.
* @attribute startTime
* @type Int
- * @default 0
+ * @default 0
* @readOnly
*/
startTime: {
@@ -262,7 +262,7 @@ YUI.add('anim-base', function (Y, NAME) {
* Current time the animation has been running.
* @attribute elapsedTime
* @type Int
- * @default 0
+ * @default 0
* @readOnly
*/
elapsedTime: {
@@ -272,9 +272,9 @@ YUI.add('anim-base', function (Y, NAME) {
/**
* Whether or not the animation is currently running.
- * @attribute running
+ * @attribute running
* @type Boolean
- * @default false
+ * @default false
* @readOnly
*/
running: {
@@ -286,10 +286,10 @@ YUI.add('anim-base', function (Y, NAME) {
},
/**
- * The number of times the animation should run
+ * The number of times the animation should run
* @attribute iterations
* @type Int
- * @default 1
+ * @default 1
*/
iterations: {
value: 1
@@ -297,7 +297,7 @@ YUI.add('anim-base', function (Y, NAME) {
/**
* The number of iterations that have occurred.
- * Resets when an animation ends (reaches iteration count or stop() called).
+ * Resets when an animation ends (reaches iteration count or stop() called).
* @attribute iterationCount
* @type Int
* @default 0
@@ -309,7 +309,7 @@ YUI.add('anim-base', function (Y, NAME) {
},
/**
- * How iterations of the animation should behave.
+ * 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.
*
@@ -323,9 +323,9 @@ YUI.add('anim-base', function (Y, NAME) {
/**
* Whether or not the animation is currently paused.
- * @attribute paused
+ * @attribute paused
* @type Boolean
- * @default false
+ * @default false
* @readOnly
*/
paused: {
@@ -337,7 +337,7 @@ YUI.add('anim-base', function (Y, NAME) {
* If true, animation begins from last frame
* @attribute reverse
* @type Boolean
- * @default false
+ * @default false
*/
reverse: {
value: false
@@ -350,10 +350,11 @@ YUI.add('anim-base', function (Y, NAME) {
* Runs all animation instances.
* @method run
* @static
- */
+ */
Y.Anim.run = function() {
- var instances = Y.Anim._instances;
- for (var i in instances) {
+ var instances = Y.Anim._instances,
+ i;
+ for (i in instances) {
if (instances[i].run) {
instances[i].run();
}
@@ -364,7 +365,7 @@ YUI.add('anim-base', function (Y, NAME) {
* 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) {
@@ -379,7 +380,7 @@ YUI.add('anim-base', function (Y, NAME) {
* 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) {
@@ -388,7 +389,7 @@ YUI.add('anim-base', function (Y, NAME) {
}
Y.Anim._stopTimer();
};
-
+
Y.Anim._startTimer = function() {
if (!_timer) {
_timer = setInterval(Y.Anim._runFrame, Y.Anim._intervalTime);
@@ -405,10 +406,11 @@ YUI.add('anim-base', function (Y, NAME) {
* @method _runFrame
* @private
* @static
- */
+ */
Y.Anim._runFrame = function() {
- var done = true;
- for (var anim in _running) {
+ var done = true,
+ anim;
+ for (anim in _running) {
if (_running[anim]._runFrame) {
done = false;
_running[anim]._runFrame();
@@ -427,7 +429,7 @@ YUI.add('anim-base', function (Y, NAME) {
* Starts or resumes an animation.
* @method run
* @chainable
- */
+ */
run: function() {
if (this.get(PAUSED)) {
this._resume();
@@ -443,7 +445,7 @@ YUI.add('anim-base', function (Y, NAME) {
* Calling run() will continue where it left off.
* @method pause
* @chainable
- */
+ */
pause: function() {
if (this.get(RUNNING)) {
this._pause();
@@ -456,7 +458,7 @@ YUI.add('anim-base', function (Y, NAME) {
* @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);
@@ -525,10 +527,8 @@ YUI.add('anim-base', function (Y, NAME) {
var d = this._runtimeAttr.duration,
t = new Date() - this.get(START_TIME),
reverse = this.get(REVERSE),
- done = (t >= d),
- attribute,
- setter;
-
+ done = (t >= d);
+
this._runAttrs(t, d, reverse);
this._actualFrames += 1;
this._set(ELAPSED_TIME, t);
@@ -565,9 +565,9 @@ YUI.add('anim-base', function (Y, NAME) {
customAttr[i].set : Y.Anim.DEFAULT_SETTER;
if (!done) {
- setter(this, i, attribute.from, attribute.to, t, d, easing, attribute.unit);
+ 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);
+ setter(this, i, attribute.from, attribute.to, lastFrame, d, easing, attribute.unit);
}
}
}
@@ -624,8 +624,8 @@ YUI.add('anim-base', function (Y, NAME) {
begin = begin.call(this, node);
}
- var mFrom = Y.Anim.RE_UNITS.exec(begin);
- var mTo = Y.Anim.RE_UNITS.exec(val);
+ var mFrom = Y.Anim.RE_UNITS.exec(begin),
+ mTo = Y.Anim.RE_UNITS.exec(val);
begin = mFrom ? mFrom[1] : begin;
end = mTo ? mTo[1] : val;
@@ -657,10 +657,11 @@ YUI.add('anim-base', function (Y, NAME) {
var node = this._node,
val = node.getComputedStyle(attr),
get = (attr === 'left') ? 'getX': 'getY',
- set = (attr === 'left') ? 'setX': 'setY';
+ set = (attr === 'left') ? 'setX': 'setY',
+ position;
if (val === 'auto') {
- var position = node.getStyle('position');
+ position = node.getStyle('position');
if (position === 'absolute' || position === 'fixed') {
val = node[get]();
node[set](val);
View
12 build/anim-color/anim-color-coverage.js
@@ -26,7 +26,7 @@ _yuitest_coverage["build/anim-color/anim-color.js"] = {
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"].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) {"," 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;
@@ -73,9 +73,9 @@ 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));
+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);
@@ -92,10 +92,10 @@ _yuitest_coverline("build/anim-color/anim-color.js", 41);
Y.each(['backgroundColor',
'borderColor',
'borderTopColor',
- 'borderRightColor',
- 'borderBottomColor',
+ 'borderRightColor',
+ 'borderBottomColor',
'borderLeftColor'],
- function(v, i) {
+ function(v) {
_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;
View
10 build/anim-color/anim-color-debug.js
@@ -27,9 +27,9 @@ Y.Anim.getUpdatedColorValue = function(fromColor, toColor, elapsed, duration, f
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));
+ 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);
@@ -41,10 +41,10 @@ Y.Anim.behaviors.color = {
Y.each(['backgroundColor',
'borderColor',
'borderTopColor',
- 'borderRightColor',
- 'borderBottomColor',
+ 'borderRightColor',
+ 'borderBottomColor',
'borderLeftColor'],
- function(v, i) {
+ function(v) {
Y.Anim.behaviors[v] = Y.Anim.behaviors.color;
}
);
View
2  build/anim-color/anim-color-min.js
@@ -1 +1 @@
-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"]});
+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){e.Anim.behaviors[t]=e.Anim.behaviors.color})},"@VERSION@",{requires:["anim-base"]});
View
10 build/anim-color/anim-color.js
@@ -27,9 +27,9 @@ Y.Anim.getUpdatedColorValue = function(fromColor, toColor, elapsed, duration, f
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));
+ 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);
@@ -41,10 +41,10 @@ Y.Anim.behaviors.color = {
Y.each(['backgroundColor',
'borderColor',
'borderTopColor',
- 'borderRightColor',
- 'borderBottomColor',
+ 'borderRightColor',
+ 'borderBottomColor',
'borderLeftColor'],
- function(v, i) {
+ function(v) {
Y.Anim.behaviors[v] = Y.Anim.behaviors.color;
}
);
View
45 build/anim-curve/anim-curve-coverage.js
@@ -26,16 +26,16 @@ _yuitest_coverage["build/anim-curve/anim-curve.js"] = {
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"].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) {"," 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,"," tmp = [],"," i,"," j;",""," for (i = 0; i < n; ++i){"," tmp[i] = [points[i][0], points[i][1]]; // save input"," }",""," for (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,"43":0,"44":0,"47":0,"48":0,"49":0,"50":0,"54":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"].coveredLines = 17;
_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>
+ * 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
@@ -58,7 +58,7 @@ to.unshift(from);
anim._node.setXY(Y.Anim.getBezier(to, t));
},
- get: function(anim, att) {
+ get: function(anim) {
_yuitest_coverfunc("build/anim-curve/anim-curve.js", "get", 19);
_yuitest_coverline("build/anim-curve/anim-curve.js", 20);
return anim._node.getXY();
@@ -70,7 +70,7 @@ return anim._node.getXY();
* 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.
+ * Additional control points are optional.
* @for Anim
* @method getBezier
* @static
@@ -79,32 +79,33 @@ return anim._node.getXY();
* @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) {
+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 = [];
+var n = points.length,
+ tmp = [],
+ i,
+ j;
- _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);
+ _yuitest_coverline("build/anim-curve/anim-curve.js", 43);
+for (i = 0; i < n; ++i){
+ _yuitest_coverline("build/anim-curve/anim-curve.js", 44);
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);
+
+ _yuitest_coverline("build/anim-curve/anim-curve.js", 47);
+for (j = 1; j < n; ++j) {
+ _yuitest_coverline("build/anim-curve/anim-curve.js", 48);
for (i = 0; i < n - j; ++i) {
- _yuitest_coverline("build/anim-curve/anim-curve.js", 47);
+ _yuitest_coverline("build/anim-curve/anim-curve.js", 49);
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", 50);
+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] ];
+ _yuitest_coverline("build/anim-curve/anim-curve.js", 54);
+return [ tmp[0][0], tmp[0][1] ];
};
View
24 build/anim-curve/anim-curve-debug.js
@@ -1,7 +1,7 @@
YUI.add('anim-curve', function (Y, NAME) {
/**
- * Adds support for the <code>curve</code> property for the <code>to</code>
+ * 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
@@ -16,7 +16,7 @@ Y.Anim.behaviors.curve = {
anim._node.setXY(Y.Anim.getBezier(to, t));
},
- get: function(anim, att) {
+ get: function(anim) {
return anim._node.getXY();
}
};
@@ -26,7 +26,7 @@ Y.Anim.behaviors.curve = {
* 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.
+ * Additional control points are optional.
* @for Anim
* @method getBezier
* @static
@@ -34,22 +34,24 @@ Y.Anim.behaviors.curve = {
* @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 = [];
+Y.Anim.getBezier = function(points, t) {
+ var n = points.length,
+ tmp = [],
+ i,
+ j;
- for (var i = 0; i < n; ++i){
+ for (i = 0; i < n; ++i){
tmp[i] = [points[i][0], points[i][1]]; // save input
}
-
- for (var j = 1; j < n; ++j) {
+
+ for (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];
+ tmp[i][1] = (1 - t) * tmp[i][1] + t * tmp[parseInt(i + 1, 10)][1];
}
}
- return [ tmp[0][0], tmp[0][1] ];
+ return [ tmp[0][0], tmp[0][1] ];
};
View
2  build/anim-curve/anim-curve-min.js
@@ -1 +1 @@
-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:["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){return e._node.getXY()}},e.Anim.getBezier=function(e,t){var n=e.length,r=[],i,s;for(i=0;i<n;++i)r[i]=[e[i][0],e[i][1]];for(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:["anim-xy"]});
View
24 build/anim-curve/anim-curve.js
@@ -1,7 +1,7 @@
YUI.add('anim-curve', function (Y, NAME) {
/**
- * Adds support for the <code>curve</code> property for the <code>to</code>
+ * 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
@@ -16,7 +16,7 @@ Y.Anim.behaviors.curve = {
anim._node.setXY(Y.Anim.getBezier(to, t));
},
- get: function(anim, att) {
+ get: function(anim) {
return anim._node.getXY();
}
};
@@ -26,7 +26,7 @@ Y.Anim.behaviors.curve = {
* 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.
+ * Additional control points are optional.
* @for Anim
* @method getBezier
* @static
@@ -34,22 +34,24 @@ Y.Anim.behaviors.curve = {
* @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 = [];
+Y.Anim.getBezier = function(points, t) {
+ var n = points.length,
+ tmp = [],
+ i,
+ j;
- for (var i = 0; i < n; ++i){
+ for (i = 0; i < n; ++i){
tmp[i] = [points[i][0], points[i][1]]; // save input
}
-
- for (var j = 1; j < n; ++j) {
+
+ for (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];
+ tmp[i][1] = (1 - t) * tmp[i][1] + t * tmp[parseInt(i + 1, 10)][1];
}
}
- return [ tmp[0][0], tmp[0][1] ];
+ return [ tmp[0][0], tmp[0][1] ];
};
View
180 build/anim-shape/anim-shape-coverage.js
@@ -26,9 +26,9 @@ _yuitest_coverage["build/anim-shape/anim-shape.js"] = {
path: "build/anim-shape/anim-shape.js",
code: []
};
-_yuitest_coverage["build/anim-shape/anim-shape.js"].code=["YUI.add('anim-shape', function (Y, NAME) {","","/**"," * Adds support for the <code>transform</code> attribute of <code>Graphic</code>"," * <code>Shape</code> instances."," * @module anim"," * @submodule anim-shape-transform"," * @deprecated Use anim-shape instead."," */","/**"," * Adds support for the <code>transform</code>, <code>fill</code>, and <code> attributes of <code>Graphic</code>"," * <code>Shape</code> instances. The <code>anim-shape</code> submodule can be used for all animations involving"," * <code>Graphic</code> <code>Shape</code> attributes. "," * "," * @module anim"," * @submodule anim-shape"," */"," var NUM = Number,"," TO,"," TOSTRING,"," COLOR = \"color\","," STOPS = \"stops\","," TYPE = \"type\","," GETUPDATEDSTOPS = function(anim, from, to, elapsed, duration, fn)"," {"," var i = 0,"," getUpdatedColorValue = Y.Anim.getUpdatedColorValue,"," toStop,"," fromStop,"," prop,"," len = to.length,"," color,"," opacity,"," offset,"," rotation,"," r,"," fx,"," fy,"," cx,"," cy,"," stops = [],"," stop;"," for(; i < len; i = i + 1)"," {"," toStop = to[i];"," fromStop = from[i];"," stop = {};"," for(prop in toStop)"," {"," if(toStop.hasOwnProperty(prop))"," {"," if(prop == COLOR)"," {"," stop[prop] = Y.Color.toHex(getUpdatedColorValue(Y.Color.toHex(fromStop[prop]), Y.Color.toHex(toStop[prop]), elapsed, duration, fn));"," }"," else"," {"," stop[prop] = fn(elapsed, NUM(fromStop[prop]), NUM(toStop[prop]) - NUM(fromStop[prop]), duration);"," }"," }"," }"," stops.push(stop);"," }"," return stops;"," },"," FILLANDSTROKEBEHAVIOR = {"," set: function(anim, att, from, to, elapsed, duration, fn) {"," var i,"," updated = {},"," getUpdatedColorValue = Y.Anim.getUpdatedColorValue,"," getUpdatedStops = GETUPDATEDSTOPS;"," for(i in to)"," {"," if(to.hasOwnProperty(i) && i != TYPE)"," {"," switch(i)"," {"," case COLOR :"," updated[i] = getUpdatedColorValue(from[i], to[i], elapsed, duration, fn);"," break;"," case STOPS :"," updated[i] = getUpdatedStops(anim, from[i], to[i], elapsed, duration, fn);"," break;"," default :"," updated[i] = fn(elapsed, NUM(from[i]), NUM(to[i]) - NUM(from[i]), duration);"," break;"," }"," }"," }"," anim._node.set(att, updated);"," }"," };"," Y.Anim.behaviors.fill = FILLANDSTROKEBEHAVIOR;"," Y.Anim.behaviors.stroke = FILLANDSTROKEBEHAVIOR; ",""," Y.Anim.behaviors.transform = {"," set: function(anim, att, from, to, elapsed, duration, fn) {"," var node = anim._node,"," transform = \"\","," transformTo,"," transformFrom,"," toArgs,"," fromArgs,"," i = 0,"," j,"," argLen,"," len;"," to = TO;"," len = TO.length;"," for(; i < len; ++i)"," {"," toArgs = to[i].concat();"," fromArgs = from[i].concat();"," transformTo = toArgs.shift();"," transformFrom = fromArgs.shift();"," argLen = toArgs.length;"," transform += transformTo + \"(\";"," for(j = 0; j < argLen; ++j)"," {"," transform += fn(elapsed, NUM(fromArgs[j]), NUM(toArgs[j]) - NUM(fromArgs[j]), duration);"," if(j < argLen - 1)"," {"," transform += \", \";"," }"," }"," transform += \");\";"," }"," if(transform)"," {"," node.set('transform', transform);"," }"," node._transform = TOSTRING;"," },"," "," get: function(anim) {"," var node = anim._node,"," fromMatrix = node.matrix,"," toAttr = anim.get(\"to\") || {},"," toString = anim.get(\"to\").transform,"," fromString = node.get(\"transform\"),"," toArray = Y.MatrixUtil.getTransformArray(toString),"," fromArray = fromString ? Y.MatrixUtil.getTransformArray(fromString) : null,"," toMatrix,"," i,"," len,"," transformFunction,"," from;"," if(toArray)"," {"," if(!fromArray || fromArray.length < 1)"," {"," fromArray = [];"," len = toArray.length;"," for(i = 0; i < len; ++i)"," {"," transformFunction = toArray[i][0];"," fromArray[i] = Y.MatrixUtil.getTransformFunctionArray(transformFunction);"," }"," TO = toArray;"," from = fromArray;"," }"," else if(Y.MatrixUtil.compareTransformSequence(toArray, fromArray))"," {"," TO = toArray;"," from = fromArray;"," }"," else"," {"," toMatrix = new Y.Matrix();"," len = toArray.length;"," for(i = 0; i < len; ++i)"," {"," transformFunction = toArray[i].shift();"," transformFunction = transformFunction == \"matrix\" ? \"multiply\" : transformFunction;"," toMatrix[transformFunction].apply(toMatrix, toArray[i]); "," }",""," TO = toMatrix.decompose();"," from = fromMatrix.decompose();"," }"," }"," TOSTRING = toString;"," return from;"," }"," }; ","","","","}, '@VERSION@', {\"requires\": [\"anim-base\", \"anim-easing\", \"anim-color\", \"matrix\"]});"];
-_yuitest_coverage["build/anim-shape/anim-shape.js"].lines = {"1":0,"18":0,"26":0,"43":0,"45":0,"46":0,"47":0,"48":0,"50":0,"52":0,"54":0,"58":0,"62":0,"64":0,"68":0,"72":0,"74":0,"76":0,"79":0,"80":0,"82":0,"83":0,"85":0,"86":0,"90":0,"93":0,"94":0,"96":0,"98":0,"108":0,"109":0,"110":0,"112":0,"113":0,"114":0,"115":0,"116":0,"117":0,"118":0,"120":0,"121":0,"123":0,"126":0,"128":0,"130":0,"132":0,"136":0,"148":0,"150":0,"152":0,"153":0,"154":0,"156":0,"157":0,"159":0,"160":0,"162":0,"164":0,"165":0,"169":0,"170":0,"171":0,"173":0,"174":0,"175":0,"178":0,"179":0,"182":0,"183":0};
-_yuitest_coverage["build/anim-shape/anim-shape.js"].functions = {"GETUPDATEDSTOPS:24":0,"set:67":0,"set:97":0,"get:135":0,"(anonymous 1):1":0};
+_yuitest_coverage["build/anim-shape/anim-shape.js"].code=["YUI.add('anim-shape', function (Y, NAME) {","","/**"," * Adds support for the <code>transform</code> attribute of <code>Graphic</code>"," * <code>Shape</code> instances."," * @module anim"," * @submodule anim-shape-transform"," * @deprecated Use anim-shape instead."," */","/**"," * Adds support for the <code>transform</code>, <code>fill</code>, and <code> attributes of <code>Graphic</code>"," * <code>Shape</code> instances. The <code>anim-shape</code> submodule can be used for all animations involving"," * <code>Graphic</code> <code>Shape</code> attributes."," *"," * @module anim"," * @submodule anim-shape"," */"," var NUM = Number,"," TO,"," TOSTRING,"," COLOR = \"color\","," STOPS = \"stops\","," TYPE = \"type\","," GETUPDATEDSTOPS = function(anim, from, to, elapsed, duration, fn)"," {"," var i = 0,"," getUpdatedColorValue = Y.Anim.getUpdatedColorValue,"," toStop,"," fromStop,"," prop,"," len = to.length,"," stops = [],"," stop;"," for(; i < len; i = i + 1)"," {"," toStop = to[i];"," fromStop = from[i];"," stop = {};"," for(prop in toStop)"," {"," if(toStop.hasOwnProperty(prop))"," {"," if(prop === COLOR)"," {"," stop[prop] = Y.Color.toHex(getUpdatedColorValue("," Y.Color.toHex(fromStop[prop]),"," Y.Color.toHex(toStop[prop]),"," elapsed,"," duration,"," fn"," ));"," }"," else"," {"," stop[prop] = fn(elapsed, NUM(fromStop[prop]), NUM(toStop[prop]) - NUM(fromStop[prop]), duration);"," }"," }"," }"," stops.push(stop);"," }"," return stops;"," },"," FILLANDSTROKEBEHAVIOR = {"," set: function(anim, att, from, to, elapsed, duration, fn) {"," var i,"," updated = {},"," getUpdatedColorValue = Y.Anim.getUpdatedColorValue,"," getUpdatedStops = GETUPDATEDSTOPS;"," for(i in to)"," {"," if(to.hasOwnProperty(i) && i !== TYPE)"," {"," switch(i)"," {"," case COLOR :"," updated[i] = getUpdatedColorValue(from[i], to[i], elapsed, duration, fn);"," break;"," case STOPS :"," updated[i] = getUpdatedStops(anim, from[i], to[i], elapsed, duration, fn);"," break;"," default :"," updated[i] = fn(elapsed, NUM(from[i]), NUM(to[i]) - NUM(from[i]), duration);"," break;"," }"," }"," }"," anim._node.set(att, updated);"," }"," };"," Y.Anim.behaviors.fill = FILLANDSTROKEBEHAVIOR;"," Y.Anim.behaviors.stroke = FILLANDSTROKEBEHAVIOR;",""," Y.Anim.behaviors.transform = {"," set: function(anim, att, from, to, elapsed, duration, fn) {"," var node = anim._node,"," transform = \"\","," transformTo,"," transformFrom,"," toArgs,"," fromArgs,"," i = 0,"," j,"," argLen,"," len;"," to = TO;"," len = TO.length;"," for(; i < len; ++i)"," {"," toArgs = to[i].concat();"," fromArgs = from[i].concat();"," transformTo = toArgs.shift();"," transformFrom = fromArgs.shift();"," argLen = toArgs.length;"," transform += transformTo + \"(\";"," for(j = 0; j < argLen; ++j)"," {"," transform += fn(elapsed, NUM(fromArgs[j]), NUM(toArgs[j]) - NUM(fromArgs[j]), duration);"," if(j < argLen - 1)"," {"," transform += \", \";"," }"," }"," transform += \");\";"," }"," if(transform)"," {"," node.set('transform', transform);"," }"," node._transform = TOSTRING;"," },",""," get: function(anim) {"," var node = anim._node,"," fromMatrix = node.matrix,"," toString = anim.get(\"to\").transform,"," fromString = node.get(\"transform\"),"," toArray = Y.MatrixUtil.getTransformArray(toString),"," fromArray = fromString ? Y.MatrixUtil.getTransformArray(fromString) : null,"," toMatrix,"," i,"," len,"," transformFunction,"," from;"," if(toArray)"," {"," if(!fromArray || fromArray.length < 1)"," {"," fromArray = [];"," len = toArray.length;"," for(i = 0; i < len; ++i)"," {"," transformFunction = toArray[i][0];"," fromArray[i] = Y.MatrixUtil.getTransformFunctionArray(transformFunction);"," }"," TO = toArray;"," from = fromArray;"," }"," else if(Y.MatrixUtil.compareTransformSequence(toArray, fromArray))"," {"," TO = toArray;"," from = fromArray;"," }"," else"," {"," toMatrix = new Y.Matrix();"," len = toArray.length;"," for(i = 0; i < len; ++i)"," {"," transformFunction = toArray[i].shift();"," transformFunction = transformFunction === \"matrix\" ? \"multiply\" : transformFunction;"," toMatrix[transformFunction].apply(toMatrix, toArray[i]);"," }",""," TO = toMatrix.decompose();"," from = fromMatrix.decompose();"," }"," }"," TOSTRING = toString;"," return from;"," }"," };","","","","}, '@VERSION@', {\"requires\": [\"anim-base\", \"anim-easing\", \"anim-color\", \"matrix\"]});"];
+_yuitest_coverage["build/anim-shape/anim-shape.js"].lines = {"1":0,"18":0,"26":0,"34":0,"36":0,"37":0,"38":0,"39":0,"41":0,"43":0,"45":0,"55":0,"59":0,"61":0,"65":0,"69":0,"71":0,"73":0,"76":0,"77":0,"79":0,"80":0,"82":0,"83":0,"87":0,"90":0,"91":0,"93":0,"95":0,"105":0,"106":0,"107":0,"109":0,"110":0,"111":0,"112":0,"113":0,"114":0,"115":0,"117":0,"118":0,"120":0,"123":0,"125":0,"127":0,"129":0,"133":0,"144":0,"146":0,"148":0,"149":0,"150":0,"152":0,"153":0,"155":0,"156":0,"158":0,"160":0,"161":0,"165":0,"166":0,"167":0,"169":0,"170":0,"171":0,"174":0,"175":0,"178":0,"179":0};
+_yuitest_coverage["build/anim-shape/anim-shape.js"].functions = {"GETUPDATEDSTOPS:24":0,"set:64":0,"set:94":0,"get:132":0,"(anonymous 1):1":0};
_yuitest_coverage["build/anim-shape/anim-shape.js"].coveredLines = 69;
_yuitest_coverage["build/anim-shape/anim-shape.js"].coveredFunctions = 5;
_yuitest_coverline("build/anim-shape/anim-shape.js", 1);
@@ -44,8 +44,8 @@ YUI.add('anim-shape', function (Y, NAME) {
/**
* Adds support for the <code>transform</code>, <code>fill</code>, and <code> attributes of <code>Graphic</code>
* <code>Shape</code> instances. The <code>anim-shape</code> submodule can be used for all animations involving
- * <code>Graphic</code> <code>Shape</code> attributes.
- *
+ * <code>Graphic</code> <code>Shape</code> attributes.
+ *
* @module anim
* @submodule anim-shape
*/
@@ -67,100 +67,97 @@ var i = 0,
fromStop,
prop,
len = to.length,
- color,
- opacity,
- offset,
- rotation,
- r,
- fx,
- fy,
- cx,
- cy,
stops = [],
stop;
- _yuitest_coverline("build/anim-shape/anim-shape.js", 43);
+ _yuitest_coverline("build/anim-shape/anim-shape.js", 34);
for(; i < len; i = i + 1)
{
- _yuitest_coverline("build/anim-shape/anim-shape.js", 45);
+ _yuitest_coverline("build/anim-shape/anim-shape.js", 36);
toStop = to[i];
- _yuitest_coverline("build/anim-shape/anim-shape.js", 46);
+ _yuitest_coverline("build/anim-shape/anim-shape.js", 37);
fromStop = from[i];
- _yuitest_coverline("build/anim-shape/anim-shape.js", 47);
+ _yuitest_coverline("build/anim-shape/anim-shape.js", 38);
stop = {};
- _yuitest_coverline("build/anim-shape/anim-shape.js", 48);
+ _yuitest_coverline("build/anim-shape/anim-shape.js", 39);
for(prop in toStop)
{
- _yuitest_coverline("build/anim-shape/anim-shape.js", 50);
+ _yuitest_coverline("build/anim-shape/anim-shape.js", 41);
if(toStop.hasOwnProperty(prop))
{
- _yuitest_coverline("build/anim-shape/anim-shape.js", 52);
-if(prop == COLOR)
+ _yuitest_coverline("build/anim-shape/anim-shape.js", 43);
+if(prop === COLOR)
{
- _yuitest_coverline("build/anim-shape/anim-shape.js", 54);
-stop[prop] = Y.Color.toHex(getUpdatedColorValue(Y.Color.toHex(fromStop[prop]), Y.Color.toHex(toStop[prop]), elapsed, duration, fn));
+ _yuitest_coverline("build/anim-shape/anim-shape.js", 45);
+stop[prop] = Y.Color.toHex(getUpdatedColorValue(
+ Y.Color.toHex(fromStop[prop]),
+ Y.Color.toHex(toStop[prop]),
+ elapsed,
+ duration,
+ fn
+ ));
}
else
{
- _yuitest_coverline("build/anim-shape/anim-shape.js", 58);
+ _yuitest_coverline("build/anim-shape/anim-shape.js", 55);
stop[prop] = fn(elapsed, NUM(fromStop[prop]), NUM(toStop[prop]) - NUM(fromStop[prop]), duration);
}
}
}
- _yuitest_coverline("build/anim-shape/anim-shape.js", 62);
+ _yuitest_coverline("build/anim-shape/anim-shape.js", 59);
stops.push(stop);
}
- _yuitest_coverline("build/anim-shape/anim-shape.js", 64);
+ _yuitest_coverline("build/anim-shape/anim-shape.js", 61);
return stops;
},
FILLANDSTROKEBEHAVIOR = {
set: function(anim, att, from, to, elapsed, duration, fn) {
- _yuitest_coverfunc("build/anim-shape/anim-shape.js", "set", 67);
-_yuitest_coverline("build/anim-shape/anim-shape.js", 68);
+ _yuitest_coverfunc("build/anim-shape/anim-shape.js", "set", 64);
+_yuitest_coverline("build/anim-shape/anim-shape.js", 65);
var i,
updated = {},
getUpdatedColorValue = Y.Anim.getUpdatedColorValue,
getUpdatedStops = GETUPDATEDSTOPS;
- _yuitest_coverline("build/anim-shape/anim-shape.js", 72);
+ _yuitest_coverline("build/anim-shape/anim-shape.js", 69);
for(i in to)
{
- _yuitest_coverline("build/anim-shape/anim-shape.js", 74);
-if(to.hasOwnProperty(i) && i != TYPE)
+ _yuitest_coverline("build/anim-shape/anim-shape.js", 71);
+if(to.hasOwnProperty(i) && i !== TYPE)
{
- _yuitest_coverline("build/anim-shape/anim-shape.js", 76);
+ _yuitest_coverline("build/anim-shape/anim-shape.js", 73);
switch(i)
{
case COLOR :
- _yuitest_coverline("build/anim-shape/anim-shape.js", 79);