Merge lp:~urbanape/lazr-js/anim-multi-node into lp:~mars/lazr-js/lazr-sprint-1109

Proposed by Zachery Bir
Status: Merged
Merge reported by: Zachery Bir
Merged at revision: not available
Proposed branch: lp:~urbanape/lazr-js/anim-multi-node
Merge into: lp:~mars/lazr-js/lazr-sprint-1109
Diff against target: 94286 lines
To merge this branch: bzr merge lp:~urbanape/lazr-js/anim-multi-node
Reviewer Review Type Date Requested Status
Paul Hummer (community) Approve
Review via email: mp+14703@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Zachery Bir (urbanape) wrote :

Provide implementation for animating multiple nodes (via a NodeList or a bare node).

Also, tests. Yay us.

lp:~urbanape/lazr-js/anim-multi-node updated
137. By Zachery Bir

A foolish consistency is the hobgoblin of little minds. To wit: mine.

138. By Zachery Bir

Use Y.all() to get our nodelist, avoiding the hassle of testing for .each,
which was fragile, and gives us a more robust API that matches Y.Anim.

Also, test for single node, node list, single node selector, and node list selector

139. By Zachery Bir

track deprecations and move:

  Y.fail => Y.error
  Y.get => Y.one

140. By Zachery Bir

Provide a robust resolveNodeListFrom function to properly return a NodeList from one
of: selector (for single or multiple objects), Node, NodeList, throwing on anything
else.

No need to extend Y.Base, since we're simply compositing anims.

Tests for resolveNodeListFrom and better tests for animating multiple nodes.

141. By Zachery Bir

Update the example for use with multiple elements

Revision history for this message
Paul Hummer (rockstar) :
review: Approve
lp:~urbanape/lazr-js/anim-multi-node updated
142. By Zachery Bir

IE javascript arrays don't seem to have filter as a native method.

143. By Zachery Bir

revert to older choiceedit on this branch

144. By Zachery Bir

Merged trunk

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file '.bzrignore'
--- .bzrignore 2009-11-03 21:59:24 +0000
+++ .bzrignore 2009-11-13 15:43:10 +0000
@@ -9,4 +9,7 @@
9./download-cache9./download-cache
10./eggs10./eggs
11./MANIFEST11./MANIFEST
12src-py/lazr_js.egg-info
13src-py/lazrjs
12*.egg-info14*.egg-info
15tags
1316
=== modified file 'Makefile'
--- Makefile 2009-11-03 21:59:24 +0000
+++ Makefile 2009-11-13 15:43:10 +0000
@@ -6,6 +6,19 @@
6WD:=$(shell pwd)6WD:=$(shell pwd)
7PY=$(WD)/bin/py7PY=$(WD)/bin/py
88
9# LAZR_SOURCEDEPS_DIR can be set to point to a directory that
10# contains a download-cache and eggs directory. If this environment
11# variable exist, the download-cache and eggs directories will be
12# symlinked, to make initial building faster.
13ifdef LAZR_SOURCEDEPS_DIR
14 CREATE_EGGS_COMMAND=ln -s $(LAZR_SOURCEDEPS_DIR)/eggs
15 CREATE_DOWNLOAD_CACHE_COMMAND=ln -s $(LAZR_SOURCEDEPS_DIR)/download-cache
16else
17 CREATE_EGGS_COMMAND=mkdir eggs
18 CREATE_DOWNLOAD_CACHE_COMMAND=bzr checkout \
19 lp:lazr-source-dependencies download-cache
20endif
21
9# Update the build directory22# Update the build directory
10build: $(PY)23build: $(PY)
11 $(PYTHON) -S bin/build24 $(PYTHON) -S bin/build
@@ -14,15 +27,19 @@
14 $(PYTHON) -S bin/jslint27 $(PYTHON) -S bin/jslint
1528
16eggs:29eggs:
17 mkdir eggs30 $(CREATE_EGGS_COMMAND)
1831
19download-cache:32download-cache:
20 bzr checkout lp:lazr-source-dependencies download-cache33 $(CREATE_DOWNLOAD_CACHE_COMMAND)
2134
22# The download-cache dependency comes *before* eggs so that developers get the35# The download-cache dependency comes *before* eggs so that developers get the
23# warning before the eggs directory is made. The target for the eggs directory36# warning before the eggs directory is made. The target for the eggs directory
24# is only there for deployment convenience.37# is only there for deployment convenience.
25bin/buildout: download-cache eggs38bin/buildout: download-cache eggs
39 if test ! -h src-py/lazrjs ; then \
40 ln -s ../src-js/lazrjs src-py/lazrjs;\
41 fi
42
26 $(SHHH) $(PYTHON) -S bootstrap.py\43 $(SHHH) $(PYTHON) -S bootstrap.py\
27 --ez_setup-source=ez_setup.py \44 --ez_setup-source=ez_setup.py \
28 --download-base=download-cache/dist --eggs=eggs45 --download-base=download-cache/dist --eggs=eggs
@@ -34,4 +51,8 @@
34clean:51clean:
35 rm -fr build/* bin52 rm -fr build/* bin
3653
54dist-clean:
55 rm -fr download-cache eggs
56 rm src-py/lazrjs
57
37.PHONY: build lint clean58.PHONY: build lint clean
3859
=== modified file 'buildout.cfg'
--- buildout.cfg 2009-10-30 16:58:21 +0000
+++ buildout.cfg 2009-11-13 15:43:10 +0000
@@ -2,12 +2,15 @@
2develop = .2develop = .
3parts =3parts =
4 scripts4 scripts
5 tags
5 test6 test
67
7unzip = true8unzip = true
8eggs-directory = eggs9eggs-directory = eggs
9download-cache = download-cache10download-cache = download-cache
1011
12extends = versions.cfg
13
11# Disable this option temporarily if you want buildout to find software14# Disable this option temporarily if you want buildout to find software
12# dependencies *other* than those in our download-cache. Once you have the15# dependencies *other* than those in our download-cache. Once you have the
13# desired software, reenable this option (and check in the new software to16# desired software, reenable this option (and check in the new software to
@@ -22,22 +25,16 @@
2225
23[scripts]26[scripts]
24recipe = zc.recipe.egg27recipe = zc.recipe.egg
28eggs =
29 cssutils
30 lazr-js
25interpreter = py31interpreter = py
32
33[tags]
34recipe = z3c.recipe.tag:tags
26eggs = lazr-js35eggs = lazr-js
2736
28[versions]
29# Alphabetical, case-insensitive, please! :-)
30bzr = 2.0.0
31lazr.testing = 0.1.1
32mocker = 0.10.1
33setuptools = 0.6c9
34zc.buildout = 1.4.1
35zc.recipe.egg = 1.2.2
36zc.recipe.testrunner = 1.2.0
37zope.exceptions = 3.5.2
38zope.interface = 3.5.1
39zope.testing = 3.8.1
40
41[test]37[test]
42recipe = zc.recipe.testrunner38recipe = zc.recipe.testrunner
39initialization = os.environ.setdefault("JSTESTDRIVER", "java -jar ${buildout:directory}/download-cache/JsTestDriver.jar")
43eggs = lazr-js40eggs = lazr-js
4441
=== modified file 'examples/anim/index.html'
--- examples/anim/index.html 2009-10-22 20:22:12 +0000
+++ examples/anim/index.html 2009-11-13 15:43:10 +0000
@@ -39,6 +39,28 @@
39 anim.run();39 anim.run();
40 }, '#example button');40 }, '#example button');
4141
42 Y.on('click', function(ev) {
43 var id = ev.target ? ev.target.getAttribute('id') : null;
44 if (!id) {
45 return; // Just in case.
46 };
47
48 var fn;
49 switch(id) {
50 case 'one': node = Y.one('#example2-table-tr-td1'); break;
51 case 'two': node = Y.one('#example2-table-tr-td2'); break;
52 case 'both': node = Y.all('#example2-table-tr td'); break;
53 default:
54 Y.fail(
55 "Oops! The button with id '" + id + "' is unrecognized.");
56 return;
57 };
58
59 var anim = Y.lazr.anim.green_flash({ node: node });
60 Y.log("Running " + id + " fade-in.", 'info');
61 anim.run();
62 }, '#example2 button');
63
42});64});
4365
44 </script>66 </script>
@@ -79,6 +101,8 @@
79});101});
80</pre>102</pre>
81103
104<h1>Configuration Options</h1>
105
82<p>The only configuration option you need to specify is the <code>node</code> that the animation will target. Any additional options will override the flash-in animation defaults.</p>106<p>The only configuration option you need to specify is the <code>node</code> that the animation will target. Any additional options will override the flash-in animation defaults.</p>
83107
84<pre>108<pre>
@@ -92,5 +116,47 @@
92blue_flash.run();116blue_flash.run();
93</pre>117</pre>
94118
119<h1>Multiple Elements</h1>
120
121<div id="example2">
122 <table border="1" id="example2-table">
123 <tr id="example2-table-tr">
124 <td id="example2-table-tr-td1">Cell One</td>
125 <td id="example2-table-tr-td2">Cell Two</td>
126 </tr>
127 </table>
128 <button id="one">Flash Cell One</button>
129 <button id="two">Flash Cell Two</button>
130 <button id="both">Flash Both Cells</button>
131</div>
132
133<p><code>node</code> can be one of: a selector (for single or multiple elements, i.e.
134<code>'#target'</code> or <code>'#target td'</code>), an individual Node object, or a
135NodeList, and the animation will occur in all nodes concurrently.</p>
136
137<pre>
138# flash a table row
139
140var blue_flash = Y.lazr.anim.flash_in({
141 node: '#target-table-row td',
142 from: { backgroundColor: '#000099' } // Override the default
143});
144
145blue_flash.run();
146</pre>
147
148is equivalent to
149
150<pre>
151# flash a table row
152
153var blue_flash = Y.lazr.anim.flash_in({
154 node: Y.all('#target-table-row td'),
155 from: { backgroundColor: '#000099' } // Override the default
156});
157
158blue_flash.run();
159</pre>
160
95</body>161</body>
96</html>162</html>
97163
=== modified file 'examples/autocomplete/index.html'
--- examples/autocomplete/index.html 2009-10-22 20:22:12 +0000
+++ examples/autocomplete/index.html 2009-11-13 15:43:10 +0000
@@ -269,6 +269,7 @@
269269
270<h1>A Simple auto-complete Widget</h1>270<h1>A Simple auto-complete Widget</h1>
271271
272<h2>Demonstration</h2>
272<div id="example">273<div id="example">
273 <label for="ac-input">Enter a country name:</label>274 <label for="ac-input">Enter a country name:</label>
274 <input id="ac-input" type="text" value="" />275 <input id="ac-input" type="text" value="" />
@@ -313,5 +314,35 @@
313 </script>314 </script>
314</div>315</div>
315316
317<h2>Page Setup</h2>
318<div>
319 <h3>Javascript</h3>
320 Add the following javascript and css tags into your page.
321 <pre>
322 &lt;script type="text/javascript" src="../../build/yui/current/build/yui/yui.js"&gt;&lt;/script&gt;
323 &lt;script type="text/javascript" src="../../build/autocomplete/autocomplete.js"&gt;&lt;/script&gt;
324 </pre>
325
326 <p>
327 The only existing markup required for the autocomplete widget is an input
328 box.
329 <pre>
330 &lt;input id="input-box" type="text" value="" /&gt;
331 </pre>
332 </p>
333
334</div>
335
336<h2>Widget Setup</h2>
337<div>
338 The AutoComplete widget requires two ATTRs on creation: a node id and an
339 array containing data.
340 <pre>
341 var autocomplete = new Y.lazr.AutoComplete({
342 input: '#input-box',
343 data: ['Mike', 'Fred', 'Barney']
344 });
345 autocomplete.render();
346 </pre>
316</body>347</body>
317</html>348</html>
318349
=== modified file 'examples/inlineeditor/index.html'
--- examples/inlineeditor/index.html 2009-10-30 16:58:21 +0000
+++ examples/inlineeditor/index.html 2009-11-13 15:43:10 +0000
@@ -13,9 +13,6 @@
13 relative paths to images.13 relative paths to images.
14 -->14 -->
15 <link type="text/css" rel="stylesheet" href="../../build/lazr-sam.css"></link>15 <link type="text/css" rel="stylesheet" href="../../build/lazr-sam.css"></link>
16 <link type="text/css" rel="stylesheet" href="../../build/lazr/assets/skins/sam/lazr.css"></link>
17 <link type="text/css" rel="stylesheet" href="../../build/inlineedit/assets/skins/sam/editor.css"></link>
18 <link rel="stylesheet" type="text/css" href="../../build/inlineedit/assets/skins/sam/editor-skin.css" />
19 <style>16 <style>
20 #example {17 #example {
21 margin-left: 20px;18 margin-left: 20px;
2219
=== modified file 'examples/picker/index.html'
--- examples/picker/index.html 2009-10-22 20:22:12 +0000
+++ examples/picker/index.html 2009-11-13 15:43:10 +0000
@@ -65,6 +65,8 @@
6565
6666
67 var picker = new Y.Picker({67 var picker = new Y.Picker({
68 picker_activator: '#show-widget',
69 clear_on_cancel: true,
68 align: {70 align: {
69 points: [Y.WidgetPositionExt.CC, Y.WidgetPositionExt.CC]71 points: [Y.WidgetPositionExt.CC, Y.WidgetPositionExt.CC]
70 },72 },
@@ -129,9 +131,6 @@
129 });131 });
130 });132 });
131133
132 Y.on('click', function () {
133 picker.show();
134 }, '#show-widget');
135 Y.on('change', function () {134 Y.on('change', function () {
136 picker.set(135 picker.set(
137 'min_search_chars',136 'min_search_chars',
138137
=== modified file 'setup.py'
--- setup.py 2009-11-03 21:59:24 +0000
+++ setup.py 2009-11-13 15:43:10 +0000
@@ -6,7 +6,7 @@
6import sys6import sys
7from setuptools import setup, find_packages7from setuptools import setup, find_packages
88
9__version__ = '0.9DEV'9__version__ = '0.9.1DEV'
1010
1111
12setup(12setup(
@@ -14,7 +14,7 @@
14 namespace_packages=['lazr'],14 namespace_packages=['lazr'],
15 version=__version__,15 version=__version__,
16 packages=['lazr', 'lazrjs'],16 packages=['lazr', 'lazrjs'],
17 py_modules=['jsmin', 'slimmer'],17 py_modules=['jsmin'],
18 package_dir={18 package_dir={
19 'lazrjs': 'src-js/lazrjs',19 'lazrjs': 'src-js/lazrjs',
20 '': 'src-py'},20 '': 'src-py'},
@@ -26,6 +26,7 @@
26 license='GPL v3',26 license='GPL v3',
27 install_requires=[27 install_requires=[
28 'bzr',28 'bzr',
29 'cssutils',
29 'lazr.testing',30 'lazr.testing',
30 'setuptools',31 'setuptools',
31 ],32 ],
3233
=== modified file 'src-js/lazrjs/anim/anim.js'
--- src-js/lazrjs/anim/anim.js 2009-03-12 02:55:06 +0000
+++ src-js/lazrjs/anim/anim.js 2009-11-13 15:43:10 +0000
@@ -13,31 +13,8 @@
13 */13 */
14Y.lazr.anim.flash_in = function(cfg) {14Y.lazr.anim.flash_in = function(cfg) {
15 var acfg = Y.merge(Y.lazr.anim.flash_in.defaults, cfg);15 var acfg = Y.merge(Y.lazr.anim.flash_in.defaults, cfg);
16 var anim = new Y.Anim(acfg);16 var anim = new Y.lazr.anim.Anim(acfg);
1717
18 // We need to validate the config afterwards because some of the
19 // properties may be dynamic.
20 var to = acfg.to;
21
22 // Check the background color to make sure it isn't 'transparent'.
23 if (to && typeof to.backgroundColor === 'function') {
24 var bg = to.backgroundColor.call(anim, anim.get('node'));
25 if (bg == 'transparent') {
26 Y.fail("Can not animate to a 'transparent' background " +
27 "in '" + anim + "'");
28 }
29 }
30
31 // Reset the background color. This is normally only necessary when the
32 // original background color of the node or its parent are not white,
33 // since we normally fade to white.
34 var original_bg = null;
35 anim.on('start', function () {
36 original_bg = anim.get('node').getStyle('backgroundColor');
37 });
38 anim.on('end', function () {
39 anim.get('node').setStyle('backgroundColor', original_bg);
40 });
41 return anim;18 return anim;
42};19};
4320
@@ -81,4 +58,91 @@
81 from: { backgroundColor: '#FF6666' }58 from: { backgroundColor: '#FF6666' }
82};59};
8360
84}, '0.1', {requires:['anim']});61var resolveNodeListFrom = function(protonode) {
62 if (typeof protonode === 'string') {
63 // selector
64 return Y.all(protonode);
65 } else if (protonode._node !== undefined) {
66 // Node
67 return new Y.NodeList([protonode]);
68 } else if (protonode._nodes !== undefined) {
69 // NodeList
70 return protonode;
71 }
72
73 throw('Not a selector, Node, or NodeList');
74};
75
76/*
77 * The Anim widget similar to Y.anim.Anim, but supports operating on a NodeList
78 *
79 * @class Anim
80 */
81Anim = function(cfg) {
82 var nodelist = resolveNodeListFrom(cfg.node);
83 this._anims = [];
84 var self = this;
85 var config = cfg;
86 Y.each(nodelist,
87 function(n) {
88 var ncfg = Y.merge(config, {node: n});
89 var anim = new Y.Anim(ncfg);
90 // We need to validate the config
91 // afterwards because some of the
92 // properties may be dynamic.
93 var to = ncfg.to;
94
95 // Check the background color to make sure
96 // it isn't 'transparent'.
97 if (to && typeof to.backgroundColor === 'function') {
98 var bg = to.backgroundColor.call(
99 anim, anim.get('node'));
100 if (bg == 'transparent') {
101 Y.error("Can not animate to a 'transparent' background " +
102 "in '" + anim + "'");
103 }
104 }
105
106 // Reset the background color. This is
107 // normally only necessary when the
108 // original background color of the node
109 // or its parent are not white, since we
110 // normally fade to white.
111 var original_bg = null;
112 anim.on('start', function () {
113 original_bg = anim.get('node').getStyle('backgroundColor');
114 });
115 anim.on('end', function () {
116 anim.get('node').setStyle('backgroundColor', original_bg);
117 });
118
119 self._anims.push(anim);
120 }
121 );
122};
123
124Anim.prototype = {
125 run: function() {
126 // delegate all behavior back to our collection of Anims
127 Y.each(this._anims,
128 function(n) {
129 n.run();
130 }
131 );
132 },
133
134 on: function() {
135 // delegate all behavior back to our collection of Anims
136 var args = arguments;
137 Y.each(this._anims,
138 function(n) {
139 n.on.apply(n, args);
140 }
141 );
142 }
143};
144
145Y.lazr.anim.Anim = Anim;
146Y.lazr.anim.resolveNodeListFrom = resolveNodeListFrom;
147
148}, '0.1', {requires:['base', 'node', 'anim']});
85149
=== added directory 'src-js/lazrjs/anim/tests'
=== added file 'src-js/lazrjs/anim/tests/anim.html'
--- src-js/lazrjs/anim/tests/anim.html 1970-01-01 00:00:00 +0000
+++ src-js/lazrjs/anim/tests/anim.html 2009-11-13 15:43:10 +0000
@@ -0,0 +1,27 @@
1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3<html>
4 <head>
5 <title>Anim</title>
6
7 <!-- YUI 3.0 Setup -->
8 <script type="text/javascript" src="../../yui/current/build/yui/yui.js"></script>
9 <link rel="stylesheet" href="../../yui/current/build/cssreset/reset.css"/>
10 <link rel="stylesheet" href="../../yui/current/build/cssfonts/fonts.css"/>
11 <link rel="stylesheet" href="../../yui/current/build/cssbase/base.css"/>
12
13 <!-- The module under test -->
14 <script type="text/javascript" src="../../anim/anim.js"></script>
15 <script type="text/javascript" src="../../lazr/lazr.js"></script>
16 <script type="text/javascript" src="../../testing/testing.js"></script>
17
18 <!-- The test suite -->
19 <script type="text/javascript" src="anim.js"></script>
20
21 <link rel="stylesheet" href="../../testing/assets/testlogger.css"/>
22</head>
23<body class="yui-skin-sam">
24
25<div id="log"></div>
26</body>
27</html>
028
=== added file 'src-js/lazrjs/anim/tests/anim.js'
--- src-js/lazrjs/anim/tests/anim.js 1970-01-01 00:00:00 +0000
+++ src-js/lazrjs/anim/tests/anim.js 2009-11-13 15:43:10 +0000
@@ -0,0 +1,191 @@
1/* Copyright (c) 2009, Canonical Ltd. All rights reserved. */
2
3YUI({
4 base: '../../yui/current/build/',
5 filter: 'raw',
6 combine: false
7 }).use('lazr.anim', 'lazr.testing.runner', 'node',
8 'event', 'event-simulate', 'console', function(Y) {
9
10var Assert = Y.Assert; // For easy access to isTrue(), etc.
11
12var suite = new Y.Test.Suite("Anim Tests");
13
14suite.add(new Y.Test.Case({
15
16 name: 'anim_basics',
17
18 setUp: function() {
19 this.workspace = Y.one('#workspace');
20 if (!this.workspace){
21 Y.one(document.body).appendChild(Y.Node.create(
22 '<div id="workspace">'
23 + '<table id="anim-table">'
24 + '<tr id="anim-table-tr">'
25 + '<td id="anim-table-td1" style="background: #eeeeee">foo</td>'
26 + '<td id="anim-table-td2" style="background: #eeeeee">bar</td>'
27 + '</tr></table></div>'));
28 this.workspace = Y.one('#workspace');
29 }
30 },
31
32 tearDown: function() {
33 this.workspace.get('parentNode').removeChild(this.workspace);
34 },
35
36 test_resolveNodeListFrom_selector: function() {
37 var nodelist = Y.lazr.anim.resolveNodeListFrom('#anim-table-td1');
38 var nodelist_nodes = (nodelist._nodes !== undefined);
39 Assert.isTrue(nodelist_nodes, 'Not a nodelist from a selector');
40 },
41
42 test_resolveNodeListFrom_node: function() {
43 var node = Y.one('#anim-table-td1');
44 var nodelist = Y.lazr.anim.resolveNodeListFrom(node);
45 var nodelist_nodes = (nodelist._nodes !== undefined);
46 Assert.isTrue(nodelist_nodes, 'Not a nodelist from a Node');
47 },
48
49 test_resolveNodeListFrom_node_list: function() {
50 var nodelist = Y.all('#anim-table td');
51 var nodelist = Y.lazr.anim.resolveNodeListFrom(nodelist);
52 var nodelist_nodes = (nodelist._nodes !== undefined);
53 Assert.isTrue(nodelist_nodes, 'Not a nodelist from a NodeList');
54 },
55
56 test_resolveNodeListFrom_anythine_else: function() {
57 var succeed = true;
58 try {
59 var nodelist = Y.lazr.anim.resolveNodeListFrom(
60 {crazy: true, broken: 'definitely'});
61 } catch(e) {
62 succeed = false;
63 }
64 Assert.isFalse(succeed, "Somehow, we're cleverer than we thought.");
65 },
66
67 test_green_flash_td1: function() {
68 // works as expected on a single node,
69 // without coercion into a NodeList here
70 var node = Y.one('#anim-table-td1');
71 var bgcolor = node.getStyle('backgroundColor');
72 var anim = Y.lazr.anim.green_flash(
73 {node: node,
74 to: {backgroundColor: bgcolor},
75 duration: 0.2}
76 );
77 anim.run();
78 this.wait(function() {
79 Assert.areEqual(
80 bgcolor,
81 node.getStyle('backgroundColor'),
82 'background colors do not match'
83 );
84 }, 500
85 );
86 },
87
88 test_green_flash_td1_by_selector: function() {
89 // works as expected on a single node selector,
90 // without coercion into a NodeList here
91 var node = Y.one('#anim-table-td1');
92 var bgcolor = node.getStyle('backgroundColor');
93 var anim = Y.lazr.anim.green_flash(
94 {node: '#anim-table-td1',
95 to: {backgroundColor: bgcolor},
96 duration: 0.2}
97 );
98 anim.run();
99 this.wait(function() {
100 Assert.areEqual(
101 bgcolor,
102 node.getStyle('backgroundColor'),
103 'background colors do not match'
104 );
105 }, 500
106 );
107 },
108
109 test_green_flash_multi: function() {
110 // works with a native NodeList as well
111 var nodelist = Y.all('#anim-table td');
112 var red = '#ff0000';
113 var backgrounds = [];
114 Y.each(nodelist, function(n) {
115 backgrounds.push({bg: n.getStyle('backgroundColor'), node: n});
116 });
117 var anim = Y.lazr.anim.green_flash(
118 {node: nodelist,
119 to: {backgroundColor: red},
120 duration: 5}
121 );
122 anim.run();
123 this.wait(function() {
124 Assert.areNotEqual(
125 backgrounds[0].node.getStyle('backgroundColor'),
126 red,
127 'background of 0 has mysteriously jumped to the end color.'
128 );
129 Assert.areNotEqual(
130 backgrounds[1].node.getStyle('backgroundColor'),
131 red,
132 'background of 1 has mysteriously jumped to the end color.'
133 );
134 Assert.areNotEqual(
135 backgrounds[0].node.getStyle('backgroundColor'),
136 backgrounds[0].bg,
137 'background of 0 has not changed at all.'
138 );
139 Assert.areNotEqual(
140 backgrounds[1].node.getStyle('backgroundColor'),
141 backgrounds[1].bg,
142 'background of 1 has not changed at all.'
143 );
144 }, 1500
145 );
146 },
147
148 test_green_flash_multi_by_selector: function() {
149 // works with a native NodeList as well
150 var nodelist = Y.all('#anim-table td');
151 var red = '#ff0000';
152 var backgrounds = [];
153 Y.each(nodelist, function(n) {
154 backgrounds.push({bg: n.getStyle('backgroundColor'), node: n});
155 });
156 var anim = Y.lazr.anim.green_flash(
157 {node: '#anim-table td',
158 to: {backgroundColor: red},
159 duration: 2}
160 );
161 anim.run();
162 this.wait(function() {
163 Assert.areNotEqual(
164 backgrounds[0].node.getStyle('backgroundColor'),
165 red,
166 'background of 0 has mysteriously jumped to the end color.'
167 );
168 Assert.areNotEqual(
169 backgrounds[1].node.getStyle('backgroundColor'),
170 red,
171 'background of 1 has mysteriously jumped to the end color.'
172 );
173 Assert.areNotEqual(
174 backgrounds[0].node.getStyle('backgroundColor'),
175 backgrounds[0].bg,
176 'background of 0 has not changed at all.'
177 );
178 Assert.areNotEqual(
179 backgrounds[1].node.getStyle('backgroundColor'),
180 backgrounds[1].bg,
181 'background of 1 has not changed at all.'
182 );
183 }, 500
184 );
185 }
186 }));
187
188Y.lazr.testing.Runner.add(suite);
189Y.lazr.testing.Runner.run();
190
191});
0192
=== modified file 'src-js/lazrjs/choiceedit/choiceedit.js'
--- src-js/lazrjs/choiceedit/choiceedit.js 2009-10-23 18:21:21 +0000
+++ src-js/lazrjs/choiceedit/choiceedit.js 2009-11-13 15:43:10 +0000
@@ -180,15 +180,7 @@
180 } else {180 } else {
181 var clickable_element = this.get('editicon');181 var clickable_element = this.get('editicon');
182 }182 }
183 clickable_element.on("mousedown", this._onMouseDown, this);183 clickable_element.on("click", this.onClick, this);
184 if (Y.UA.opera && !this.get('clickable_content')) {
185 // In Opera, cancelling the mousedown event for an <a> tag
186 // doesn't prevent the link from loading, so we need to add
187 // an on-click handler to make sure the on-click event is
188 // cancelled explicitly.
189 Y.get(this.get("contentBox")).on(
190 "click", function (e) { e.halt(); }, this);
191 }
192184
193 this.after("valueChange", function(e) {185 this.after("valueChange", function(e) {
194 this.syncUI();186 this.syncUI();
@@ -235,13 +227,13 @@
235 },227 },
236228
237 /**229 /**
238 * Handle mousedown and create the ChoiceList to allow user to230 * Handle click and create the ChoiceList to allow user to
239 * select an item231 * select an item
240 *232 *
241 * @method _onMouseDown233 * @method onClick
242 * @private234 * @private
243 */235 */
244 _onMouseDown: function(e) {236 onClick: function(e) {
245237
246 // Only continue if the down button is the left one.238 // Only continue if the down button is the left one.
247 if (e.button != LEFT_MOUSE_BUTTON) {239 if (e.button != LEFT_MOUSE_BUTTON) {
248240
=== modified file 'src-js/lazrjs/choiceedit/tests/choiceedit.js'
--- src-js/lazrjs/choiceedit/tests/choiceedit.js 2009-10-22 18:37:47 +0000
+++ src-js/lazrjs/choiceedit/tests/choiceedit.js 2009-11-13 15:43:10 +0000
@@ -104,7 +104,7 @@
104 },104 },
105105
106 test_clicking_creates_choicelist: function() {106 test_clicking_creates_choicelist: function() {
107 simulate(this.choice_edit.get('boundingBox'), '.value', 'mousedown');107 simulate(this.choice_edit.get('boundingBox'), '.value', 'click');
108 Assert.isNotNull(this.choice_edit._choice_list,108 Assert.isNotNull(this.choice_edit._choice_list,
109 "ChoiceList object is not created");109 "ChoiceList object is not created");
110 Assert.isNotNull(Y.get(document).query(".yui-ichoicelist"),110 Assert.isNotNull(Y.get(document).query(".yui-ichoicelist"),
@@ -113,13 +113,13 @@
113113
114 test_right_clicking_doesnt_create_choicelist: function() {114 test_right_clicking_doesnt_create_choicelist: function() {
115 simulate(this.choice_edit.get('boundingBox'),115 simulate(this.choice_edit.get('boundingBox'),
116 '.value', 'mousedown', { button: 2 });116 '.value', 'click', { button: 2 });
117 Assert.isNull(Y.get(document).query(".yui-ichoicelist"),117 Assert.isNull(Y.get(document).query(".yui-ichoicelist"),
118 "ChoiceList created when the right mouse button was clicked");118 "ChoiceList created when the right mouse button was clicked");
119 },119 },
120120
121 test_choicelist_has_correct_values: function() {121 test_choicelist_has_correct_values: function() {
122 simulate(this.choice_edit.get('boundingBox'), '.value', 'mousedown');122 simulate(this.choice_edit.get('boundingBox'), '.value', 'click');
123 var that = this;123 var that = this;
124 Y.each(this.config.items, function(configitem) {124 Y.each(this.config.items, function(configitem) {
125 var found = false;125 var found = false;
@@ -140,7 +140,7 @@
140 },140 },
141141
142 test_choicelist_html_has_correct_values: function() {142 test_choicelist_html_has_correct_values: function() {
143 simulate(this.choice_edit.get('boundingBox'), '.value', 'mousedown');143 simulate(this.choice_edit.get('boundingBox'), '.value', 'click');
144 var configcount = this.config.items.length;144 var configcount = this.config.items.length;
145 var choicelist_lis = Y.get(document).queryAll(".yui-ichoicelist li");145 var choicelist_lis = Y.get(document).queryAll(".yui-ichoicelist li");
146 Assert.areEqual(choicelist_lis.size(), configcount,146 Assert.areEqual(choicelist_lis.size(), configcount,
@@ -163,7 +163,7 @@
163 },163 },
164164
165 test_choicelist_html_has_disabled: function() {165 test_choicelist_html_has_disabled: function() {
166 simulate(this.choice_edit.get('boundingBox'), '.value', 'mousedown');166 simulate(this.choice_edit.get('boundingBox'), '.value', 'click');
167 var configcount = this.config.items.length;167 var configcount = this.config.items.length;
168 var choicelist_lis = Y.get(document).queryAll(".yui-ichoicelist li");168 var choicelist_lis = Y.get(document).queryAll(".yui-ichoicelist li");
169 // confirm that disabled LIs are disabled169 // confirm that disabled LIs are disabled
@@ -183,7 +183,7 @@
183 },183 },
184184
185 test_choicelist_html_has_current: function() {185 test_choicelist_html_has_current: function() {
186 simulate(this.choice_edit.get('boundingBox'), '.value', 'mousedown');186 simulate(this.choice_edit.get('boundingBox'), '.value', 'click');
187 var configcount = this.config.items.length;187 var configcount = this.config.items.length;
188 var choicelist_lis = Y.get(document).queryAll(".yui-ichoicelist li");188 var choicelist_lis = Y.get(document).queryAll(".yui-ichoicelist li");
189 // confirm that current value has an LI with current style189 // confirm that current value has an LI with current style
@@ -206,7 +206,7 @@
206 },206 },
207207
208 test_clicking_choicelist_item_fires_signal: function() {208 test_clicking_choicelist_item_fires_signal: function() {
209 simulate(this.choice_edit.get('boundingBox'), '.value', 'mousedown');209 simulate(this.choice_edit.get('boundingBox'), '.value', 'click');
210 var that = this;210 var that = this;
211 this.choice_edit._choice_list.on("valueChosen", function() {211 this.choice_edit._choice_list.on("valueChosen", function() {
212 that.resume();212 that.resume();
@@ -221,7 +221,7 @@
221 },221 },
222222
223 test_clicking_choicelist_item_does_green_flash: function() {223 test_clicking_choicelist_item_does_green_flash: function() {
224 simulate(this.choice_edit.get('boundingBox'), '.value', 'mousedown');224 simulate(this.choice_edit.get('boundingBox'), '.value', 'click');
225 var that = this;225 var that = this;
226 var green_flash = Y.lazr.anim.green_flash;226 var green_flash = Y.lazr.anim.green_flash;
227 Y.lazr.anim.green_flash = function() {227 Y.lazr.anim.green_flash = function() {
@@ -241,7 +241,7 @@
241 test_clicking_choicelist_item_sets_page_value: function() {241 test_clicking_choicelist_item_sets_page_value: function() {
242 var st = Y.get(document).query("#thestatus");242 var st = Y.get(document).query("#thestatus");
243 // The page value is set to item.name of the selected item.243 // The page value is set to item.name of the selected item.
244 simulate(this.choice_edit.get('boundingBox'), '.value', 'mousedown');244 simulate(this.choice_edit.get('boundingBox'), '.value', 'click');
245 simulate(this.choice_edit._choice_list.get('boundingBox'),245 simulate(this.choice_edit._choice_list.get('boundingBox'),
246 'li a[href$=fixreleased]', 'click');246 'li a[href$=fixreleased]', 'click');
247 Assert.areEqual("Fix Released", st.query(".value").get("innerHTML"),247 Assert.areEqual("Fix Released", st.query(".value").get("innerHTML"),
@@ -254,7 +254,7 @@
254 // By default, the page value is set to item.name of the254 // By default, the page value is set to item.name of the
255 // selected item, but this can be overridden by specifying255 // selected item, but this can be overridden by specifying
256 // item.source_name.256 // item.source_name.
257 simulate(this.choice_edit.get('boundingBox'), '.value', 'mousedown');257 simulate(this.choice_edit.get('boundingBox'), '.value', 'click');
258 var choice_list_bb = this.choice_edit._choice_list.get('boundingBox');258 var choice_list_bb = this.choice_edit._choice_list.get('boundingBox');
259 var stalled_in_list = choice_list_bb.query('li a[href$=stalled]');259 var stalled_in_list = choice_list_bb.query('li a[href$=stalled]');
260 Assert.areEqual(260 Assert.areEqual(
@@ -303,7 +303,7 @@
303 },303 },
304304
305 test_clicking_content_doesnt_create_choicelist: function() {305 test_clicking_content_doesnt_create_choicelist: function() {
306 simulate(this.choice_edit.get('boundingBox'), '.value', 'mousedown');306 simulate(this.choice_edit.get('boundingBox'), '.value', 'click');
307 Assert.isUndefined(this.choice_edit._choice_list,307 Assert.isUndefined(this.choice_edit._choice_list,
308 "ChoiceList object is created");308 "ChoiceList object is created");
309 Assert.isNull(Y.get(document).query(".yui-ichoicelist"),309 Assert.isNull(Y.get(document).query(".yui-ichoicelist"),
@@ -311,7 +311,7 @@
311 },311 },
312312
313 test_clicking_icon_creates_choicelist: function() {313 test_clicking_icon_creates_choicelist: function() {
314 simulate(this.choice_edit.get('boundingBox'), '.editicon', 'mousedown');314 simulate(this.choice_edit.get('boundingBox'), '.editicon', 'click');
315 Assert.isNotUndefined(this.choice_edit._choice_list,315 Assert.isNotUndefined(this.choice_edit._choice_list,
316 "ChoiceList object is not being created");316 "ChoiceList object is not being created");
317 Assert.isNotNull(Y.get(document).query(".yui-ichoicelist"),317 Assert.isNotNull(Y.get(document).query(".yui-ichoicelist"),
@@ -359,7 +359,7 @@
359 },359 },
360360
361 test_choicelist_html_has_current: function() {361 test_choicelist_html_has_current: function() {
362 simulate(this.choice_edit.get('boundingBox'), '.value', 'mousedown');362 simulate(this.choice_edit.get('boundingBox'), '.value', 'click');
363 var configcount = this.config.items.length;363 var configcount = this.config.items.length;
364 var choicelist_lis = Y.get(document).queryAll(".yui-ichoicelist li");364 var choicelist_lis = Y.get(document).queryAll(".yui-ichoicelist li");
365365
@@ -390,7 +390,7 @@
390 simulate(this.choice_edit._choice_list.get('boundingBox'),390 simulate(this.choice_edit._choice_list.get('boundingBox'),
391 'li a[href$=new]', 'click');391 'li a[href$=new]', 'click');
392 this.wait(3000, function() {392 this.wait(3000, function() {
393 simulate(this.choice_edit.get('boundingBox'), '.value', 'mousedown');393 simulate(this.choice_edit.get('boundingBox'), '.value', 'click');
394 asserted = false;394 asserted = false;
395 choicelist_lis.each(test_li);395 choicelist_lis.each(test_li);
396 Assert.isTrue(asserted, "There was no current LI item");396 Assert.isTrue(asserted, "There was no current LI item");
@@ -470,7 +470,7 @@
470 "Edit icon is visible when it shouldn't be");470 "Edit icon is visible when it shouldn't be");
471471
472 simulate(this.null_choice_edit.get('boundingBox'),472 simulate(this.null_choice_edit.get('boundingBox'),
473 '.value', 'mousedown');473 '.value', 'click');
474 simulate(this.null_choice_edit._choice_list.get('boundingBox'),474 simulate(this.null_choice_edit._choice_list.get('boundingBox'),
475 'li a[href$=groucho]', 'click');475 'li a[href$=groucho]', 'click');
476 this.null_choice_edit._uiClearWaiting();476 this.null_choice_edit._uiClearWaiting();
@@ -496,7 +496,7 @@
496 "Selected value isn't null");496 "Selected value isn't null");
497497
498 simulate(this.null_choice_edit.get('boundingBox'),498 simulate(this.null_choice_edit.get('boundingBox'),
499 '.value', 'mousedown');499 '.value', 'click');
500 var remove_action_present = false;500 var remove_action_present = false;
501 this.null_choice_edit._choice_list.get(501 this.null_choice_edit._choice_list.get(
502 'boundingBox').queryAll('li a').each(function(item) {502 'boundingBox').queryAll('li a').each(function(item) {
@@ -517,7 +517,7 @@
517 "getInput() did not return the current value");517 "getInput() did not return the current value");
518 // Simulate choosing a null value and check that getInput()518 // Simulate choosing a null value and check that getInput()
519 // returns the new value.519 // returns the new value.
520 this.null_choice_edit._onMouseDown({button: 1, halt: function(){}});520 this.null_choice_edit.onClick({button: 1, halt: function(){}});
521 this.null_choice_edit._choice_list.fire('valueChosen', null);521 this.null_choice_edit._choice_list.fire('valueChosen', null);
522 Assert.areEqual(522 Assert.areEqual(
523 null,523 null,
524524
=== modified file 'src-js/lazrjs/inlineedit/assets/skins/sam/editor-skin.css'
--- src-js/lazrjs/inlineedit/assets/skins/sam/editor-skin.css 2009-10-28 00:27:52 +0000
+++ src-js/lazrjs/inlineedit/assets/skins/sam/editor-skin.css 2009-11-13 15:43:10 +0000
@@ -2,7 +2,7 @@
22
3.yui-skin-sam .yui-ieditor-errors {3.yui-skin-sam .yui-ieditor-errors {
4 padding: 0.2em 0 0.5em 0.5em;4 padding: 0.2em 0 0.5em 0.5em;
5 font: sans-serif;5 font-family: sans-serif;
6 font-size: 0.5em;6 font-size: 0.5em;
7 color: red;7 color: red;
8}8}
@@ -66,7 +66,7 @@
66}66}
6767
68.yui-skin-sam .yui-ieditor-waiting .yui-ieditor-btns {68.yui-skin-sam .yui-ieditor-waiting .yui-ieditor-btns {
69 background: url(../../../../lazr/assets/skins/sam/spinner.gif) 0.2em 0em no-repeat;69 background: url("../../../../lazr/assets/skins/sam/spinner.gif") 0.2em 0em no-repeat;
70}70}
7171
72/*72/*
7373
=== modified file 'src-js/lazrjs/inlineedit/editor.js'
--- src-js/lazrjs/inlineedit/editor.js 2009-10-30 16:58:21 +0000
+++ src-js/lazrjs/inlineedit/editor.js 2009-11-13 15:43:10 +0000
@@ -1154,6 +1154,7 @@
1154 node: cancel,1154 node: cancel,
1155 easing: Y.Easing.easeOut,1155 easing: Y.Easing.easeOut,
1156 duration: 0.2,1156 duration: 0.2,
1157 from: { left: 0 },
1157 to: { left: -4 }1158 to: { left: -4 }
1158 });1159 });
1159 var self = this;1160 var self = this;
11601161
=== modified file 'src-js/lazrjs/overlay/assets/skins/sam/pretty-overlay-skin.css'
--- src-js/lazrjs/overlay/assets/skins/sam/pretty-overlay-skin.css 2009-04-21 16:25:06 +0000
+++ src-js/lazrjs/overlay/assets/skins/sam/pretty-overlay-skin.css 2009-11-13 15:43:10 +0000
@@ -141,7 +141,7 @@
141141
142.yui-pretty-overlay .step-off,142.yui-pretty-overlay .step-off,
143.yui-pretty-overlay .step-offb {143.yui-pretty-overlay .step-offb {
144 background: grey url('images/bg_steps-estatus.gif') bottom repeat-x;144 background: gray url('images/bg_steps-estatus.gif') bottom repeat-x;
145}145}
146146
147.yui-pretty-overlay .yui-widget-bd {147.yui-pretty-overlay .yui-widget-bd {
148148
=== modified file 'src-js/lazrjs/overlay/overlay.js'
--- src-js/lazrjs/overlay/overlay.js 2009-10-23 18:24:21 +0000
+++ src-js/lazrjs/overlay/overlay.js 2009-11-13 15:43:10 +0000
@@ -209,11 +209,10 @@
209 var visible = this.get('visible');209 var visible = this.get('visible');
210 if (visible) {210 if (visible) {
211 Y.get('body').appendChild(this._blocking_div);211 Y.get('body').appendChild(this._blocking_div);
212 this._doc_kp_handler = Y.on('keypress', function(e) {212 // Handle Escape (code 27) on keydown.
213 if (e.keyCode == ESCAPE) {213 this._doc_kp_handler = Y.on('key', function() {
214 self.fire(CANCEL);214 self.fire(CANCEL);
215 }215 }, document, 'down:27');
216 }, document);
217 } else {216 } else {
218 this._removeBlockingDiv();217 this._removeBlockingDiv();
219 }218 }
220219
=== modified file 'src-js/lazrjs/overlay/tests/overlay.js'
--- src-js/lazrjs/overlay/tests/overlay.js 2009-10-22 18:37:47 +0000
+++ src-js/lazrjs/overlay/tests/overlay.js 2009-11-13 15:43:10 +0000
@@ -51,6 +51,12 @@
51 cleanup_widget(this.overlay);51 cleanup_widget(this.overlay);
52 },52 },
5353
54 hitEscape: function() {
55 simulate(this.overlay.get('boundingBox'),
56 '.close .close-button',
57 'keydown', { keyCode: ESCAPE });
58 },
59
54 test_picker_can_be_instantiated: function() {60 test_picker_can_be_instantiated: function() {
55 this.overlay = new Y.lazr.PrettyOverlay();61 this.overlay = new Y.lazr.PrettyOverlay();
56 Assert.isInstanceOf(62 Assert.isInstanceOf(
@@ -146,9 +152,7 @@
146 this.overlay = new Y.lazr.PrettyOverlay();152 this.overlay = new Y.lazr.PrettyOverlay();
147 this.overlay.render();153 this.overlay.render();
148154
149 simulate(this.overlay.get('boundingBox'),155 this.hitEscape();
150 '.close .close-button',
151 'keypress', { keyCode: ESCAPE });
152 Assert.isFalse(this.overlay.get('visible'), "The widget wasn't hidden");156 Assert.isFalse(this.overlay.get('visible'), "The widget wasn't hidden");
153 },157 },
154158
@@ -162,9 +166,7 @@
162 event_was_fired = true;166 event_was_fired = true;
163 });167 });
164 }, this);168 }, this);
165 simulate(this.overlay.get('boundingBox'),169 this.hitEscape();
166 '.close .close-button',
167 'click', { keyCode: ESCAPE });
168 this.wait(function() {170 this.wait(function() {
169 Assert.isTrue(event_was_fired, "cancel event wasn't fired");171 Assert.isTrue(event_was_fired, "cancel event wasn't fired");
170 }, 3000);172 }, 3000);
@@ -177,15 +179,11 @@
177 this.overlay = new Y.lazr.PrettyOverlay();179 this.overlay = new Y.lazr.PrettyOverlay();
178 this.overlay.render();180 this.overlay.render();
179181
180 simulate(this.overlay.get('boundingBox'),182 this.hitEscape();
181 '.close .close-button',
182 'keypress', { keyCode: ESCAPE });
183 Assert.isFalse(this.overlay.get('visible'), "The widget wasn't hidden");183 Assert.isFalse(this.overlay.get('visible'), "The widget wasn't hidden");
184 this.overlay.show();184 this.overlay.show();
185 Assert.isTrue(this.overlay.get('visible'), "The widget wasn't shown again");185 Assert.isTrue(this.overlay.get('visible'), "The widget wasn't shown again");
186 simulate(this.overlay.get('boundingBox'),186 this.hitEscape();
187 '.close .close-button',
188 'keypress', { keyCode: ESCAPE });
189 Assert.isFalse(this.overlay.get('visible'), "The widget wasn't hidden");187 Assert.isFalse(this.overlay.get('visible'), "The widget wasn't hidden");
190 },188 },
191189
@@ -193,7 +191,7 @@
193 this.overlay = new Y.lazr.PrettyOverlay();191 this.overlay = new Y.lazr.PrettyOverlay();
194 function PrettyOverlaySubclass(config) {192 function PrettyOverlaySubclass(config) {
195 PrettyOverlaySubclass.superclass.constructor.apply(this, arguments);193 PrettyOverlaySubclass.superclass.constructor.apply(this, arguments);
196 };194 }
197 PrettyOverlaySubclass.NAME = 'lazr-overlaysubclass';195 PrettyOverlaySubclass.NAME = 'lazr-overlaysubclass';
198 Y.extend(PrettyOverlaySubclass, Y.lazr.PrettyOverlay);196 Y.extend(PrettyOverlaySubclass, Y.lazr.PrettyOverlay);
199197
@@ -206,14 +204,13 @@
206 test_overlay_bodyContent_has_size_1: function() {204 test_overlay_bodyContent_has_size_1: function() {
207 var overlay = new Y.Overlay({205 var overlay = new Y.Overlay({
208 headerContent: 'Form for testing',206 headerContent: 'Form for testing',
209 bodyContent: '<input type="text" name="field1" />',207 bodyContent: '<input type="text" name="field1" />'
210 });208 });
211 overlay.render();209 overlay.render();
212 Assert.areEqual(210 Assert.areEqual(
213 1,211 1,
214 overlay.get("bodyContent").size(),212 overlay.get("bodyContent").size(),
215 "The bodContent should contain only one node."213 "The bodContent should contain only one node.");
216 )
217 },214 },
218215
219 test_set_progress: function() {216 test_set_progress: function() {
@@ -226,7 +223,7 @@
226 Assert.areEqual(223 Assert.areEqual(
227 '23%',224 '23%',
228 this.overlay.get('boundingBox').query('.steps .step-on').getStyle('width')225 this.overlay.get('boundingBox').query('.steps .step-on').getStyle('width')
229 )226 );
230 }227 }
231228
232}));229}));
233230
=== modified file 'src-js/lazrjs/picker/picker.js'
--- src-js/lazrjs/picker/picker.js 2009-10-22 19:27:45 +0000
+++ src-js/lazrjs/picker/picker.js 2009-11-13 15:43:10 +0000
@@ -166,6 +166,20 @@
166 * @preventable _defaultSave166 * @preventable _defaultSave
167 */167 */
168 this.publish(SAVE, { defaultFn: this._defaultSave } );168 this.publish(SAVE, { defaultFn: this._defaultSave } );
169
170 // Subscribe to the cancel event so that we can clear the widget when
171 // requested.
172 this.subscribe('cancel', this._defaultCancel);
173
174 if ( this.get('picker_activator') ) {
175 var element = Y.one(this.get('picker_activator'));
176 element.on('click', function(e) {
177 e.halt();
178 this.show();
179 }, this);
180 element.addClass(this.get('picker_activator_css_class'));
181 }
182
169 },183 },
170184
171 /**185 /**
@@ -499,7 +513,7 @@
499 // is changed, and reset the selected one to the first one.513 // is changed, and reset the selected one to the first one.
500 this.after('batchesChange', function (e) {514 this.after('batchesChange', function (e) {
501 this._syncBatchesUI();515 this._syncBatchesUI();
502 if (this.get(SELECTED_BATCH) == 0){516 if (this.get(SELECTED_BATCH) === 0){
503 // If the attribute is already set to the same value,517 // If the attribute is already set to the same value,
504 // the 'after' events won't be triggered, so we have518 // the 'after' events won't be triggered, so we have
505 // to trigger it manually.519 // to trigger it manually.
@@ -550,6 +564,21 @@
550 this._search_input.focus();564 this._search_input.focus();
551 },565 },
552566
567 /*
568 * Clear all elements of the picker, resetting it to its original state.
569 *
570 * @method _clear
571 * @param e {Object} The event object.
572 * @protected
573 */
574 _clear: function() {
575 this._search_input.set('value', '');
576 this.set('error', '');
577 this.set('results', [{}]);
578 this._results_box.set('innerHTML', '');
579 this.set('batches', []);
580 },
581
553 /**582 /**
554 * Handle clicks on the 'Search' button or entering the enter key in the583 * Handle clicks on the 'Search' button or entering the enter key in the
555 * search field. This fires the search event.584 * search field. This fires the search event.
@@ -585,8 +614,25 @@
585 },614 },
586615
587 /**616 /**
588 * By default, the save event simply hides the widget. The search entered617 * By default, the cancel event just hides the widget, but you can
589 * by the user is passed in the first details attribute of the event.618 * have it also cleared by setting clear_on_cancel to 'true'.
619 *
620 * @method _defaultCancel
621 * @param e {Event.Facade} An Event Facade object.
622 * @protected
623 */
624 _defaultCancel : function(e) {
625 Picker.superclass._defaultCancel.apply(this, arguments);
626 if ( this.get('clear_on_cancel') ) {
627 this._clear();
628 }
629 },
630
631 /**
632 * By default, the save event clears and hides the widget, but you can
633 * have it not cleared by setting clear_on_save to 'false'. The search
634 * entered by the user is passed in the first details attribute of the
635 * event.
590 *636 *
591 * @method _defaultSave637 * @method _defaultSave
592 * @param e {Event.Facade} An Event Facade object.638 * @param e {Event.Facade} An Event Facade object.
@@ -594,6 +640,9 @@
594 */640 */
595 _defaultSave : function(e) {641 _defaultSave : function(e) {
596 this.hide();642 this.hide();
643 if ( this.get('clear_on_save') ) {
644 this._clear();
645 }
597 },646 },
598647
599 /**648 /**
@@ -637,6 +686,42 @@
637686
638Picker.ATTRS = {687Picker.ATTRS = {
639 /**688 /**
689 * Whether or not the search box and result list should be cleared when
690 * the save event is fired.
691 *
692 * @attribute clear_on_save
693 * @type Boolean
694 */
695 clear_on_save: { value: true },
696
697 /**
698 * Whether or not the search box and result list should be cleared when
699 * the cancel event is fired.
700 *
701 * @attribute clear_on_cancel
702 * @type Boolean
703 */
704 clear_on_cancel: { value: false },
705
706 /**
707 * A CSS selector for the DOM element that will activate (show) the picker
708 * once clicked.
709 *
710 * @attribute picker_activator
711 * @type String
712 */
713 picker_activator: { value: null },
714
715 /**
716 * An extra CSS class to be added to the picker_activator, generally used
717 * to distinguish regular links from js-triggering ones.
718 *
719 * @attribute picker_activator_css_class
720 * @type String
721 */
722 picker_activator_css_class: { value: 'js-action' },
723
724 /**
640 * Minimum number of characters that need to be entered in the search725 * Minimum number of characters that need to be entered in the search
641 * string input before a search event will be fired. The search string726 * string input before a search event will be fired. The search string
642 * will be trimmed before testing the length.727 * will be trimmed before testing the length.
643728
=== modified file 'src-js/lazrjs/picker/tests/picker.js'
--- src-js/lazrjs/picker/tests/picker.js 2009-10-21 21:43:07 +0000
+++ src-js/lazrjs/picker/tests/picker.js 2009-11-13 15:43:10 +0000
@@ -206,7 +206,7 @@
206 [false, true, false, true], results.hasClass(Y.lazr.ui.CSS_ODD));206 [false, true, false, true], results.hasClass(Y.lazr.ui.CSS_ODD));
207 },207 },
208208
209 test_clicking_search_button_fires_save_event: function () {209 test_clicking_search_button_fires_search_event: function () {
210 this.picker.render();210 this.picker.render();
211211
212 var bb = this.picker.get('boundingBox');212 var bb = this.picker.get('boundingBox');
@@ -379,6 +379,14 @@
379 }, 3000);379 }, 3000);
380 },380 },
381381
382 test_cancel_event_hides_widget: function () {
383 this.picker.render();
384
385 this.picker.fire('cancel', 'bogus');
386 Assert.isFalse(
387 this.picker.get('visible'), "The widget should be hidden.");
388 },
389
382 test_save_event_hides_widget: function () {390 test_save_event_hides_widget: function () {
383 this.picker.render();391 this.picker.render();
384392
@@ -387,6 +395,48 @@
387 this.picker.get('visible'), "The widget should be hidden.");395 this.picker.get('visible'), "The widget should be hidden.");
388 },396 },
389397
398 test_save_event_clears_widget_by_default: function () {
399 this.picker.render();
400
401 this.picker._search_input.set('value', 'foo');
402 this.picker.fire('save', 'bogus');
403 Assert.areEqual(
404 '', this.picker._search_input.get('value'),
405 "The widget hasn't been cleared");
406 },
407
408 test_save_does_not_clear_widget_when_clear_on_save_is_false: function () {
409 picker = new Y.Picker({clear_on_save: false});
410 picker.render();
411
412 picker._search_input.set('value', 'foo');
413 picker.fire('save', 'bogus');
414 Assert.areEqual(
415 'foo', picker._search_input.get('value'),
416 "The widget has been cleared but it should not");
417 },
418
419 test_cancel_event_does_not_clear_widget_by_default: function () {
420 this.picker.render();
421
422 this.picker._search_input.set('value', 'foo');
423 this.picker.fire('cancel', 'bogus');
424 Assert.areEqual(
425 'foo', this.picker._search_input.get('value'),
426 "The widget has been cleared but it should not");
427 },
428
429 test_cancel_event_clears_widget_when_clear_on_cancel_is_true: function () {
430 picker = new Y.Picker({clear_on_cancel: true});
431 picker.render();
432
433 picker._search_input.set('value', 'foo');
434 picker.fire('cancel', 'bogus');
435 Assert.areEqual(
436 '', picker._search_input.get('value'),
437 "The widget hasn't been cleared");
438 },
439
390 test_search_clears_any_eror: function () {440 test_search_clears_any_eror: function () {
391 this.picker.render();441 this.picker.render();
392 this.picker.set('error', "An error");442 this.picker.set('error', "An error");
393443
=== removed directory 'src-js/lazrjs/yui/3.0.0pr2'
=== removed directory 'src-js/lazrjs/yui/3.0.0pr2/build'
=== removed directory 'src-js/lazrjs/yui/3.0.0pr2/build/anim'
=== removed file 'src-js/lazrjs/yui/3.0.0pr2/build/anim/README'
--- src-js/lazrjs/yui/3.0.0pr2/build/anim/README 2008-12-15 13:29:08 +0000
+++ src-js/lazrjs/yui/3.0.0pr2/build/anim/README 1970-01-01 00:00:00 +0000
@@ -1,8 +0,0 @@
1**** version 3.0.0 PR2 ***
2
3* easing attribute now accepts string ("easeOut" resolves to Y.Easing.easeOut)
4
5
6**** version 3.0.0 PR1 ***
7
8* initial 3.0 revision
90
=== removed file 'src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-base-debug.js'
--- src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-base-debug.js 2008-12-15 13:29:08 +0000
+++ src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-base-debug.js 1970-01-01 00:00:00 +0000
@@ -1,593 +0,0 @@
1/*
2Copyright (c) 2008, Yahoo! Inc. All rights reserved.
3Code licensed under the BSD License:
4http://developer.yahoo.net/yui/license.txt
5version: 3.0.0pr2
6*/
7YUI.add('anim-base', function(Y) {
8
9/**
10 * Y.Animation Utility.
11 * @module anim
12 */
13
14 /**
15 * Handles animation _queueing and threading.
16 * @class Anim
17 * @constructor
18 * @extends Base
19 */
20
21 var RUNNING = 'running',
22 START_TIME = 'startTime',
23 ELAPSED_TIME = 'elapsedTime',
24 /**
25 * @event start
26 * @description fires when an animation begins.
27 * @param {Event} ev The start event.
28 * @type Event.Custom
29 */
30 START = 'start',
31
32 /**
33 * @event tween
34 * @description fires every frame of the animation.
35 * @param {Event} ev The tween event.
36 * @type Event.Custom
37 */
38 TWEEN = 'tween',
39
40 /**
41 * @event end
42 * @description fires after the animation completes.
43 * @param {Event} ev The end event.
44 * @type Event.Custom
45 */
46 END = 'end',
47 NODE = 'node',
48 PAUSED = 'paused',
49 REVERSE = 'reverse', // TODO: cleanup
50 ITERATION_COUNT = 'iterationCount',
51
52 NUM = Number;
53
54 var _running = {},
55 _instances = {},
56 _timer;
57
58 Y.Anim = function() {
59 Y.Anim.superclass.constructor.apply(this, arguments);
60 _instances[Y.stamp(this)] = this;
61 };
62
63 Y.Anim.NAME = 'anim';
64
65 /**
66 * Regex of properties that should use the default unit.
67 *
68 * @property RE_DEFAULT_UNIT
69 * @static
70 */
71 Y.Anim.RE_DEFAULT_UNIT = /^width|height|top|right|bottom|left|margin.*|padding.*|border.*$/i;
72
73 /**
74 * The default unit to use with properties that pass the RE_DEFAULT_UNIT test.
75 *
76 * @property DEFAULT_UNIT
77 * @static
78 */
79 Y.Anim.DEFAULT_UNIT = 'px';
80
81 Y.Anim.DEFAULT_EASING = function (t, b, c, d) {
82 return c * t / d + b; // linear easing
83 };
84
85 /**
86 * Bucket for custom getters and setters
87 *
88 * @property behaviors
89 * @static
90 */
91 Y.Anim.behaviors = {
92 left: {
93 get: function(anim, attr) {
94 return anim._getOffset(attr);
95 }
96 }
97 };
98
99 Y.Anim.behaviors.top = Y.Anim.behaviors.left;
100
101 /**
102 * The default setter to use when setting object properties.
103 *
104 * @property DEFAULT_SETTER
105 * @static
106 */
107 Y.Anim.DEFAULT_SETTER = function(anim, att, from, to, elapsed, duration, fn, unit) {
108 unit = unit || '';
109 anim._node.setStyle(att, fn(elapsed, NUM(from), NUM(to) - NUM(from), duration) + unit);
110 };
111
112 /**
113 * The default getter to use when getting object properties.
114 *
115 * @property DEFAULT_GETTER
116 * @static
117 */
118 Y.Anim.DEFAULT_GETTER = function(anim, prop) {
119 return anim._node.getComputedStyle(prop);
120 };
121
122 Y.Anim.ATTRS = {
123 /**
124 * The object to be animated.
125 * @attribute node
126 * @type Node
127 */
128 node: {
129 set: function(node) {
130 node = Y.Node.get(node);
131 this._node = node;
132 if (!node) {
133 Y.fail('Y.Anim: invalid node: ' + node);
134 }
135 return node;
136 }
137 },
138
139 /**
140 * The length of the animation. Defaults to "1" (second).
141 * @attribute duration
142 * @type NUM
143 */
144 duration: {
145 value: 1
146 },
147
148 /**
149 * The method that will provide values to the attribute(s) during the animation.
150 * Defaults to "Easing.easeNone".
151 * @attribute easing
152 * @type Function
153 */
154 easing: {
155 value: Y.Anim.DEFAULT_EASING,
156
157 set: function(val) {
158 if (typeof val === 'string' && Y.Easing) {
159 return Y.Easing[val];
160 }
161 }
162 },
163
164 /**
165 * The starting values for the animated properties.
166 * Fields may be strings, numbers, or functions.
167 * If a function is used, the return value becomes the from value.
168 * If no from value is specified, the DEFAULT_GETTER will be used.
169 * @attribute from
170 * @type Object
171 */
172 from: {},
173
174 /**
175 * The ending values for the animated properties.
176 * Fields may be strings, numbers, or functions.
177 * @attribute to
178 * @type Object
179 */
180 to: {},
181
182 /**
183 * Date stamp for the first frame of the animation.
184 * @attribute startTime
185 * @type Int
186 * @default 0
187 * @readOnly
188 */
189 startTime: {
190 value: 0,
191 readOnly: true
192 },
193
194 /**
195 * Current time the animation has been running.
196 * @attribute elapsedTime
197 * @type Int
198 * @default 0
199 * @readOnly
200 */
201 elapsedTime: {
202 value: 0,
203 readOnly: true
204 },
205
206 /**
207 * Whether or not the animation is currently running.
208 * @attribute running
209 * @type Boolean
210 * @default false
211 * @readOnly
212 */
213 running: {
214 get: function() {
215 return !!_running[Y.stamp(this)];
216 },
217 value: false,
218 readOnly: true
219 },
220
221 /**
222 * The number of times the animation should run
223 * @attribute iterations
224 * @type Int
225 * @default 1
226 */
227 iterations: {
228 value: 1
229 },
230
231 /**
232 * The number of iterations that have occurred.
233 * Resets when an animation ends (reaches iteration count or stop() called).
234 * @attribute iterationCount
235 * @type Int
236 * @default 0
237 * @readOnly
238 */
239 iterationCount: {
240 value: 0,
241 readOnly: true
242 },
243
244 /**
245 * How iterations of the animation should behave.
246 * Possible values are "normal" and "alternate".
247 * Normal will repeat the animation, alternate will reverse on every other pass.
248 *
249 * @attribute direction
250 * @type String
251 * @default "normal"
252 */
253 direction: {
254 value: 'normal' // | alternate (fwd on odd, rev on even per spec)
255 },
256
257 /**
258 * Whether or not the animation is currently paused.
259 * @attribute running
260 * @type Boolean
261 * @default false
262 * @readOnly
263 */
264 paused: {
265 readOnly: true,
266 value: false
267 },
268
269 /**
270 * If true, animation begins from last frame
271 * @attribute reverse
272 * @type Boolean
273 * @default false
274 */
275 reverse: {
276 value: false
277 }
278
279
280 };
281
282 /**
283 * Runs all animation instances.
284 * @method run
285 * @static
286 */
287 Y.Anim.run = function() {
288 for (var i in _instances) {
289 if (_instances[i].run) {
290 _instances[i].run();
291 }
292 }
293 };
294
295 /**
296 * Pauses all animation instances.
297 * @method pause
298 * @static
299 */
300 Y.Anim.pause = function() {
301 for (var i in _running) { // stop timer if nothing running
302 if (_running[i].pause) {
303 _running[i].pause();
304 }
305 }
306 Y.Anim._stopTimer();
307 };
308
309 /**
310 * Stops all animation instances.
311 * @method stop
312 * @static
313 */
314 Y.Anim.stop = function() {
315 for (var i in _running) { // stop timer if nothing running
316 if (_running[i].stop) {
317 _running[i].stop();
318 }
319 }
320 Y.Anim._stopTimer();
321 };
322
323 Y.Anim._startTimer = function() {
324 if (!_timer) {
325 _timer = setInterval(Y.Anim._runFrame, 1);
326 }
327 };
328
329 Y.Anim._stopTimer = function() {
330 clearInterval(_timer);
331 _timer = 0;
332 };
333
334 /**
335 * Called per Interval to handle each animation frame.
336 * @method _runFrame
337 * @private
338 * @static
339 */
340 Y.Anim._runFrame = function() {
341 var done = true;
342 for (var anim in _running) {
343 if (_running[anim]._runFrame) {
344 done = false;
345 _running[anim]._runFrame();
346 }
347 }
348
349 if (done) {
350 Y.Anim._stopTimer();
351 }
352 };
353
354 Y.Anim.RE_UNITS = /^(-?\d*\.?\d*){1}(em|ex|px|in|cm|mm|pt|pc|%)*$/;
355
356 var proto = {
357 /**
358 * Starts or resumes an animation.
359 * percent start time marker.
360 * @method run
361 * @chainable
362 */
363 run: function() {
364 if (!this.get(RUNNING)) {
365 this._start();
366 } else if (this.get(PAUSED)) {
367 this._resume();
368 }
369 return this;
370 },
371
372 /**
373 * Pauses the animation and
374 * freezes it in its current state and time.
375 * Calling run() will continue where it left off.
376 * @method pause
377 * @chainable
378 */
379 pause: function() {
380 if (this.get(RUNNING)) {
381 this._pause();
382 }
383 return this;
384 },
385
386 /**
387 * Stops the animation and resets its time.
388 * @method stop
389 * @chainable
390 */
391 stop: function(finish) {
392 if (this.get(RUNNING) || this.get(PAUSED)) {
393 this._end(finish);
394 }
395 return this;
396 },
397
398 _added: false,
399
400 _start: function() {
401 this._set(START_TIME, new Date() - this.get(ELAPSED_TIME));
402 this._actualFrames = 0;
403 if (!this.get(PAUSED)) {
404 this._initAttr();
405 }
406 _running[Y.stamp(this)] = this;
407 Y.Anim._startTimer();
408
409 this.fire(START);
410 },
411
412 _pause: function() {
413 this._set(START_TIME, null);
414 this._set(PAUSED, true);
415 delete _running[Y.stamp(this)];
416
417 /**
418 * @event pause
419 * @description fires when an animation is paused.
420 * @param {Event} ev The pause event.
421 * @type Event.Custom
422 */
423 this.fire('pause');
424 },
425
426 _resume: function() {
427 this._set(PAUSED, false);
428 _running[Y.stamp(this)] = this;
429
430 /**
431 * @event resume
432 * @description fires when an animation is resumed (run from pause).
433 * @param {Event} ev The pause event.
434 * @type Event.Custom
435 */
436 this.fire('resume');
437 },
438
439 _end: function(finish) {
440 this._set(START_TIME, null);
441 this._set(ELAPSED_TIME, 0);
442 this._set(PAUSED, false);
443
444 delete _running[Y.stamp(this)];
445 this.fire(END, {elapsed: this.get(ELAPSED_TIME)});
446 },
447
448 _runFrame: function() {
449 var attr = this._runtimeAttr,
450 customAttr = Y.Anim.behaviors,
451 easing = attr.easing,
452 d = attr.duration,
453 t = new Date() - this.get(START_TIME),
454 reversed = this.get(REVERSE),
455 done = (t >= d),
456 lastFrame = d,
457 attribute,
458 setter;
459
460 if (reversed) {
461 t = d - t;
462 done = (t <= 0);
463 lastFrame = 0;
464 }
465
466 for (var i in attr) {
467 if (attr[i].to) {
468 attribute = attr[i];
469 setter = (i in customAttr && 'set' in customAttr[i]) ?
470 customAttr[i].set : Y.Anim.DEFAULT_SETTER;
471
472 if (!done) {
473 setter(this, i, attribute.from, attribute.to, t, d, easing, attribute.unit);
474 } else { // ensure final frame value is set
475 // TODO: handle keyframes
476 setter(this, i, attribute.from, attribute.to, lastFrame, d, easing, attribute.unit);
477 }
478 }
479 }
480
481 this._actualFrames += 1;
482 this._set(ELAPSED_TIME, t);
483
484 this.fire(TWEEN);
485 if (done) {
486 this._lastFrame();
487 }
488 },
489
490 _lastFrame: function() {
491 var iter = this.get('iterations'),
492 iterCount = this.get(ITERATION_COUNT);
493
494 iterCount += 1;
495 if (iter === 'infinite' || iterCount < iter) {
496 if (this.get('direction') === 'alternate') {
497 this.set(REVERSE, !this.get(REVERSE)); // flip it
498 }
499 /**
500 * @event iteration
501 * @description fires when an animation begins an iteration.
502 * @param {Event} ev The iteration event.
503 * @type Event.Custom
504 */
505 this.fire('iteration');
506 } else {
507 iterCount = 0;
508 this._end();
509 }
510
511 this._set(START_TIME, new Date());
512 this._set(ITERATION_COUNT, iterCount);
513 },
514
515 _initAttr: function() {
516 var from = this.get('from') || {},
517 to = this.get('to') || {},
518 dur = this.get('duration') * 1000,
519 node = this.get(NODE),
520 easing = this.get('easing') || {},
521 attr = {},
522 customAttr = Y.Anim.behaviors,
523 unit, begin, end;
524
525 Y.each(to, function(val, name) {
526 if (typeof val === 'function') {
527 val = val.call(this, node);
528 }
529
530 begin = from[name];
531 if (begin === undefined) {
532 begin = (name in customAttr && 'get' in customAttr[name]) ?
533 customAttr[name].get(this, name) : Y.Anim.DEFAULT_GETTER(this, name);
534 } else if (typeof begin === 'function') {
535 begin = begin.call(this, node);
536 }
537
538 var mFrom = Y.Anim.RE_UNITS.exec(begin);
539 var mTo = Y.Anim.RE_UNITS.exec(val);
540
541 begin = mFrom ? mFrom[1] : begin;
542 var end = mTo ? mTo[1] : val,
543 unit = mTo ? mTo[2] : mFrom ? mFrom[2] : ''; // one might be zero TODO: mixed units
544
545 if (!unit && Y.Anim.RE_DEFAULT_UNIT.test(name)) {
546 unit = Y.Anim.DEFAULT_UNIT;
547 }
548
549 if (!begin || !end) {
550 Y.fail('invalid "from" or "to" for "' + name + '"', 'Anim');
551 return;
552 }
553
554 attr[name] = {
555 from: begin,
556 to: end,
557 unit: unit
558 };
559
560 attr.duration = dur;
561 attr.easing = easing;
562
563 }, this);
564
565 this._runtimeAttr = attr;
566 },
567
568
569 // TODO: move to computedStyle? (browsers dont agree on default computed offsets)
570 _getOffset: function(attr) {
571 var node = this._node,
572 val = node.getComputedStyle(attr),
573 get = (attr === 'left') ? 'getX': 'getY',
574 set = (attr === 'left') ? 'setX': 'setY';
575
576 if (val === 'auto') {
577 var position = node.getStyle('position');
578 if (position === 'absolute' || position === 'fixed') {
579 val = node[get]();
580 node[set](val);
581 } else {
582 val = 0;
583 }
584 }
585
586 return val;
587 }
588 };
589
590 Y.extend(Y.Anim, Y.Base, proto);
591
592
593}, '3.0.0pr2' ,{requires:['base', 'node']});
5940
=== removed file 'src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-base-min.js'
--- src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-base-min.js 2008-12-15 13:29:08 +0000
+++ src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-base-min.js 1970-01-01 00:00:00 +0000
@@ -1,7 +0,0 @@
1/*
2Copyright (c) 2008, Yahoo! Inc. All rights reserved.
3Code licensed under the BSD License:
4http://developer.yahoo.net/yui/license.txt
5version: 3.0.0pr2
6*/
7YUI.add("anim-base",function(B){var C="running",N="startTime",L="elapsedTime",J="start",I="tween",M="end",D="node",K="paused",P="reverse",H="iterationCount",A=Number;var F={},O={},E;B.Anim=function(){B.Anim.superclass.constructor.apply(this,arguments);O[B.stamp(this)]=this;};B.Anim.NAME="anim";B.Anim.RE_DEFAULT_UNIT=/^width|height|top|right|bottom|left|margin.*|padding.*|border.*$/i;B.Anim.DEFAULT_UNIT="px";B.Anim.DEFAULT_EASING=function(R,Q,T,S){return T*R/S+Q;};B.Anim.behaviors={left:{get:function(R,Q){return R._getOffset(Q);}}};B.Anim.behaviors.top=B.Anim.behaviors.left;B.Anim.DEFAULT_SETTER=function(U,R,X,W,Q,V,S,T){T=T||"";U._node.setStyle(R,S(Q,A(X),A(W)-A(X),V)+T);};B.Anim.DEFAULT_GETTER=function(Q,R){return Q._node.getComputedStyle(R);};B.Anim.ATTRS={node:{set:function(Q){Q=B.Node.get(Q);this._node=Q;if(!Q){B.fail("Y.Anim: invalid node: "+Q);}return Q;}},duration:{value:1},easing:{value:B.Anim.DEFAULT_EASING,set:function(Q){if(typeof Q==="string"&&B.Easing){return B.Easing[Q];}}},from:{},to:{},startTime:{value:0,readOnly:true},elapsedTime:{value:0,readOnly:true},running:{get:function(){return !!F[B.stamp(this)];},value:false,readOnly:true},iterations:{value:1},iterationCount:{value:0,readOnly:true},direction:{value:"normal"},paused:{readOnly:true,value:false},reverse:{value:false}};B.Anim.run=function(){for(var Q in O){if(O[Q].run){O[Q].run();}}};B.Anim.pause=function(){for(var Q in F){if(F[Q].pause){F[Q].pause();}}B.Anim._stopTimer();};B.Anim.stop=function(){for(var Q in F){if(F[Q].stop){F[Q].stop();}}B.Anim._stopTimer();};B.Anim._startTimer=function(){if(!E){E=setInterval(B.Anim._runFrame,1);}};B.Anim._stopTimer=function(){clearInterval(E);E=0;};B.Anim._runFrame=function(){var Q=true;for(var R in F){if(F[R]._runFrame){Q=false;F[R]._runFrame();}}if(Q){B.Anim._stopTimer();}};B.Anim.RE_UNITS=/^(-?\d*\.?\d*){1}(em|ex|px|in|cm|mm|pt|pc|%)*$/;var G={run:function(){if(!this.get(C)){this._start();}else{if(this.get(K)){this._resume();}}return this;},pause:function(){if(this.get(C)){this._pause();}return this;},stop:function(Q){if(this.get(C)||this.get(K)){this._end(Q);}return this;},_added:false,_start:function(){this._set(N,new Date()-this.get(L));this._actualFrames=0;if(!this.get(K)){this._initAttr();}F[B.stamp(this)]=this;B.Anim._startTimer();this.fire(J);},_pause:function(){this._set(N,null);this._set(K,true);delete F[B.stamp(this)];this.fire("pause");},_resume:function(){this._set(K,false);F[B.stamp(this)]=this;this.fire("resume");},_end:function(Q){this._set(N,null);this._set(L,0);this._set(K,false);delete F[B.stamp(this)];this.fire(M,{elapsed:this.get(L)});},_runFrame:function(){var X=this._runtimeAttr,S=B.Anim.behaviors,Y=X.easing,Z=X.duration,a=new Date()-this.get(N),W=this.get(P),U=(a>=Z),Q=Z,R,T;if(W){a=Z-a;U=(a<=0);Q=0;}for(var V in X){if(X[V].to){R=X[V];T=(V in S&&"set" in S[V])?S[V].set:B.Anim.DEFAULT_SETTER;if(!U){T(this,V,R.from,R.to,a,Z,Y,R.unit);}else{T(this,V,R.from,R.to,Q,Z,Y,R.unit);}}}this._actualFrames+=1;this._set(L,a);this.fire(I);if(U){this._lastFrame();}},_lastFrame:function(){var Q=this.get("iterations"),R=this.get(H);R+=1;if(Q==="infinite"||R<Q){if(this.get("direction")==="alternate"){this.set(P,!this.get(P));}this.fire("iteration");}else{R=0;this._end();}this._set(N,new Date());this._set(H,R);},_initAttr:function(){var X=this.get("from")||{},Y=this.get("to")||{},Q=this.get("duration")*1000,T=this.get(D),W=this.get("easing")||{},V={},R=B.Anim.behaviors,Z,S,U;B.each(Y,function(f,c){if(typeof f==="function"){f=f.call(this,T);}S=X[c];if(S===undefined){S=(c in R&&"get" in R[c])?R[c].get(this,c):B.Anim.DEFAULT_GETTER(this,c);}else{if(typeof S==="function"){S=S.call(this,T);}}var b=B.Anim.RE_UNITS.exec(S);var d=B.Anim.RE_UNITS.exec(f);S=b?b[1]:S;var a=d?d[1]:f,e=d?d[2]:b?b[2]:"";if(!e&&B.Anim.RE_DEFAULT_UNIT.test(c)){e=B.Anim.DEFAULT_UNIT;}if(!S||!a){B.fail('invalid "from" or "to" for "'+c+'"',"Anim");return ;}V[c]={from:S,to:a,unit:e};V.duration=Q;V.easing=W;},this);this._runtimeAttr=V;},_getOffset:function(R){var T=this._node,U=T.getComputedStyle(R),S=(R==="left")?"getX":"getY",V=(R==="left")?"setX":"setY";if(U==="auto"){var Q=T.getStyle("position");if(Q==="absolute"||Q==="fixed"){U=T[S]();T[V](U);}else{U=0;}}return U;}};B.extend(B.Anim,B.Base,G);},"3.0.0pr2",{requires:["base","node"]});
8\ No newline at end of file0\ No newline at end of file
91
=== removed file 'src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-base.js'
--- src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-base.js 2008-12-15 13:29:08 +0000
+++ src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-base.js 1970-01-01 00:00:00 +0000
@@ -1,593 +0,0 @@
1/*
2Copyright (c) 2008, Yahoo! Inc. All rights reserved.
3Code licensed under the BSD License:
4http://developer.yahoo.net/yui/license.txt
5version: 3.0.0pr2
6*/
7YUI.add('anim-base', function(Y) {
8
9/**
10 * Y.Animation Utility.
11 * @module anim
12 */
13
14 /**
15 * Handles animation _queueing and threading.
16 * @class Anim
17 * @constructor
18 * @extends Base
19 */
20
21 var RUNNING = 'running',
22 START_TIME = 'startTime',
23 ELAPSED_TIME = 'elapsedTime',
24 /**
25 * @event start
26 * @description fires when an animation begins.
27 * @param {Event} ev The start event.
28 * @type Event.Custom
29 */
30 START = 'start',
31
32 /**
33 * @event tween
34 * @description fires every frame of the animation.
35 * @param {Event} ev The tween event.
36 * @type Event.Custom
37 */
38 TWEEN = 'tween',
39
40 /**
41 * @event end
42 * @description fires after the animation completes.
43 * @param {Event} ev The end event.
44 * @type Event.Custom
45 */
46 END = 'end',
47 NODE = 'node',
48 PAUSED = 'paused',
49 REVERSE = 'reverse', // TODO: cleanup
50 ITERATION_COUNT = 'iterationCount',
51
52 NUM = Number;
53
54 var _running = {},
55 _instances = {},
56 _timer;
57
58 Y.Anim = function() {
59 Y.Anim.superclass.constructor.apply(this, arguments);
60 _instances[Y.stamp(this)] = this;
61 };
62
63 Y.Anim.NAME = 'anim';
64
65 /**
66 * Regex of properties that should use the default unit.
67 *
68 * @property RE_DEFAULT_UNIT
69 * @static
70 */
71 Y.Anim.RE_DEFAULT_UNIT = /^width|height|top|right|bottom|left|margin.*|padding.*|border.*$/i;
72
73 /**
74 * The default unit to use with properties that pass the RE_DEFAULT_UNIT test.
75 *
76 * @property DEFAULT_UNIT
77 * @static
78 */
79 Y.Anim.DEFAULT_UNIT = 'px';
80
81 Y.Anim.DEFAULT_EASING = function (t, b, c, d) {
82 return c * t / d + b; // linear easing
83 };
84
85 /**
86 * Bucket for custom getters and setters
87 *
88 * @property behaviors
89 * @static
90 */
91 Y.Anim.behaviors = {
92 left: {
93 get: function(anim, attr) {
94 return anim._getOffset(attr);
95 }
96 }
97 };
98
99 Y.Anim.behaviors.top = Y.Anim.behaviors.left;
100
101 /**
102 * The default setter to use when setting object properties.
103 *
104 * @property DEFAULT_SETTER
105 * @static
106 */
107 Y.Anim.DEFAULT_SETTER = function(anim, att, from, to, elapsed, duration, fn, unit) {
108 unit = unit || '';
109 anim._node.setStyle(att, fn(elapsed, NUM(from), NUM(to) - NUM(from), duration) + unit);
110 };
111
112 /**
113 * The default getter to use when getting object properties.
114 *
115 * @property DEFAULT_GETTER
116 * @static
117 */
118 Y.Anim.DEFAULT_GETTER = function(anim, prop) {
119 return anim._node.getComputedStyle(prop);
120 };
121
122 Y.Anim.ATTRS = {
123 /**
124 * The object to be animated.
125 * @attribute node
126 * @type Node
127 */
128 node: {
129 set: function(node) {
130 node = Y.Node.get(node);
131 this._node = node;
132 if (!node) {
133 Y.fail('Y.Anim: invalid node: ' + node);
134 }
135 return node;
136 }
137 },
138
139 /**
140 * The length of the animation. Defaults to "1" (second).
141 * @attribute duration
142 * @type NUM
143 */
144 duration: {
145 value: 1
146 },
147
148 /**
149 * The method that will provide values to the attribute(s) during the animation.
150 * Defaults to "Easing.easeNone".
151 * @attribute easing
152 * @type Function
153 */
154 easing: {
155 value: Y.Anim.DEFAULT_EASING,
156
157 set: function(val) {
158 if (typeof val === 'string' && Y.Easing) {
159 return Y.Easing[val];
160 }
161 }
162 },
163
164 /**
165 * The starting values for the animated properties.
166 * Fields may be strings, numbers, or functions.
167 * If a function is used, the return value becomes the from value.
168 * If no from value is specified, the DEFAULT_GETTER will be used.
169 * @attribute from
170 * @type Object
171 */
172 from: {},
173
174 /**
175 * The ending values for the animated properties.
176 * Fields may be strings, numbers, or functions.
177 * @attribute to
178 * @type Object
179 */
180 to: {},
181
182 /**
183 * Date stamp for the first frame of the animation.
184 * @attribute startTime
185 * @type Int
186 * @default 0
187 * @readOnly
188 */
189 startTime: {
190 value: 0,
191 readOnly: true
192 },
193
194 /**
195 * Current time the animation has been running.
196 * @attribute elapsedTime
197 * @type Int
198 * @default 0
199 * @readOnly
200 */
201 elapsedTime: {
202 value: 0,
203 readOnly: true
204 },
205
206 /**
207 * Whether or not the animation is currently running.
208 * @attribute running
209 * @type Boolean
210 * @default false
211 * @readOnly
212 */
213 running: {
214 get: function() {
215 return !!_running[Y.stamp(this)];
216 },
217 value: false,
218 readOnly: true
219 },
220
221 /**
222 * The number of times the animation should run
223 * @attribute iterations
224 * @type Int
225 * @default 1
226 */
227 iterations: {
228 value: 1
229 },
230
231 /**
232 * The number of iterations that have occurred.
233 * Resets when an animation ends (reaches iteration count or stop() called).
234 * @attribute iterationCount
235 * @type Int
236 * @default 0
237 * @readOnly
238 */
239 iterationCount: {
240 value: 0,
241 readOnly: true
242 },
243
244 /**
245 * How iterations of the animation should behave.
246 * Possible values are "normal" and "alternate".
247 * Normal will repeat the animation, alternate will reverse on every other pass.
248 *
249 * @attribute direction
250 * @type String
251 * @default "normal"
252 */
253 direction: {
254 value: 'normal' // | alternate (fwd on odd, rev on even per spec)
255 },
256
257 /**
258 * Whether or not the animation is currently paused.
259 * @attribute running
260 * @type Boolean
261 * @default false
262 * @readOnly
263 */
264 paused: {
265 readOnly: true,
266 value: false
267 },
268
269 /**
270 * If true, animation begins from last frame
271 * @attribute reverse
272 * @type Boolean
273 * @default false
274 */
275 reverse: {
276 value: false
277 }
278
279
280 };
281
282 /**
283 * Runs all animation instances.
284 * @method run
285 * @static
286 */
287 Y.Anim.run = function() {
288 for (var i in _instances) {
289 if (_instances[i].run) {
290 _instances[i].run();
291 }
292 }
293 };
294
295 /**
296 * Pauses all animation instances.
297 * @method pause
298 * @static
299 */
300 Y.Anim.pause = function() {
301 for (var i in _running) { // stop timer if nothing running
302 if (_running[i].pause) {
303 _running[i].pause();
304 }
305 }
306 Y.Anim._stopTimer();
307 };
308
309 /**
310 * Stops all animation instances.
311 * @method stop
312 * @static
313 */
314 Y.Anim.stop = function() {
315 for (var i in _running) { // stop timer if nothing running
316 if (_running[i].stop) {
317 _running[i].stop();
318 }
319 }
320 Y.Anim._stopTimer();
321 };
322
323 Y.Anim._startTimer = function() {
324 if (!_timer) {
325 _timer = setInterval(Y.Anim._runFrame, 1);
326 }
327 };
328
329 Y.Anim._stopTimer = function() {
330 clearInterval(_timer);
331 _timer = 0;
332 };
333
334 /**
335 * Called per Interval to handle each animation frame.
336 * @method _runFrame
337 * @private
338 * @static
339 */
340 Y.Anim._runFrame = function() {
341 var done = true;
342 for (var anim in _running) {
343 if (_running[anim]._runFrame) {
344 done = false;
345 _running[anim]._runFrame();
346 }
347 }
348
349 if (done) {
350 Y.Anim._stopTimer();
351 }
352 };
353
354 Y.Anim.RE_UNITS = /^(-?\d*\.?\d*){1}(em|ex|px|in|cm|mm|pt|pc|%)*$/;
355
356 var proto = {
357 /**
358 * Starts or resumes an animation.
359 * percent start time marker.
360 * @method run
361 * @chainable
362 */
363 run: function() {
364 if (!this.get(RUNNING)) {
365 this._start();
366 } else if (this.get(PAUSED)) {
367 this._resume();
368 }
369 return this;
370 },
371
372 /**
373 * Pauses the animation and
374 * freezes it in its current state and time.
375 * Calling run() will continue where it left off.
376 * @method pause
377 * @chainable
378 */
379 pause: function() {
380 if (this.get(RUNNING)) {
381 this._pause();
382 }
383 return this;
384 },
385
386 /**
387 * Stops the animation and resets its time.
388 * @method stop
389 * @chainable
390 */
391 stop: function(finish) {
392 if (this.get(RUNNING) || this.get(PAUSED)) {
393 this._end(finish);
394 }
395 return this;
396 },
397
398 _added: false,
399
400 _start: function() {
401 this._set(START_TIME, new Date() - this.get(ELAPSED_TIME));
402 this._actualFrames = 0;
403 if (!this.get(PAUSED)) {
404 this._initAttr();
405 }
406 _running[Y.stamp(this)] = this;
407 Y.Anim._startTimer();
408
409 this.fire(START);
410 },
411
412 _pause: function() {
413 this._set(START_TIME, null);
414 this._set(PAUSED, true);
415 delete _running[Y.stamp(this)];
416
417 /**
418 * @event pause
419 * @description fires when an animation is paused.
420 * @param {Event} ev The pause event.
421 * @type Event.Custom
422 */
423 this.fire('pause');
424 },
425
426 _resume: function() {
427 this._set(PAUSED, false);
428 _running[Y.stamp(this)] = this;
429
430 /**
431 * @event resume
432 * @description fires when an animation is resumed (run from pause).
433 * @param {Event} ev The pause event.
434 * @type Event.Custom
435 */
436 this.fire('resume');
437 },
438
439 _end: function(finish) {
440 this._set(START_TIME, null);
441 this._set(ELAPSED_TIME, 0);
442 this._set(PAUSED, false);
443
444 delete _running[Y.stamp(this)];
445 this.fire(END, {elapsed: this.get(ELAPSED_TIME)});
446 },
447
448 _runFrame: function() {
449 var attr = this._runtimeAttr,
450 customAttr = Y.Anim.behaviors,
451 easing = attr.easing,
452 d = attr.duration,
453 t = new Date() - this.get(START_TIME),
454 reversed = this.get(REVERSE),
455 done = (t >= d),
456 lastFrame = d,
457 attribute,
458 setter;
459
460 if (reversed) {
461 t = d - t;
462 done = (t <= 0);
463 lastFrame = 0;
464 }
465
466 for (var i in attr) {
467 if (attr[i].to) {
468 attribute = attr[i];
469 setter = (i in customAttr && 'set' in customAttr[i]) ?
470 customAttr[i].set : Y.Anim.DEFAULT_SETTER;
471
472 if (!done) {
473 setter(this, i, attribute.from, attribute.to, t, d, easing, attribute.unit);
474 } else { // ensure final frame value is set
475 // TODO: handle keyframes
476 setter(this, i, attribute.from, attribute.to, lastFrame, d, easing, attribute.unit);
477 }
478 }
479 }
480
481 this._actualFrames += 1;
482 this._set(ELAPSED_TIME, t);
483
484 this.fire(TWEEN);
485 if (done) {
486 this._lastFrame();
487 }
488 },
489
490 _lastFrame: function() {
491 var iter = this.get('iterations'),
492 iterCount = this.get(ITERATION_COUNT);
493
494 iterCount += 1;
495 if (iter === 'infinite' || iterCount < iter) {
496 if (this.get('direction') === 'alternate') {
497 this.set(REVERSE, !this.get(REVERSE)); // flip it
498 }
499 /**
500 * @event iteration
501 * @description fires when an animation begins an iteration.
502 * @param {Event} ev The iteration event.
503 * @type Event.Custom
504 */
505 this.fire('iteration');
506 } else {
507 iterCount = 0;
508 this._end();
509 }
510
511 this._set(START_TIME, new Date());
512 this._set(ITERATION_COUNT, iterCount);
513 },
514
515 _initAttr: function() {
516 var from = this.get('from') || {},
517 to = this.get('to') || {},
518 dur = this.get('duration') * 1000,
519 node = this.get(NODE),
520 easing = this.get('easing') || {},
521 attr = {},
522 customAttr = Y.Anim.behaviors,
523 unit, begin, end;
524
525 Y.each(to, function(val, name) {
526 if (typeof val === 'function') {
527 val = val.call(this, node);
528 }
529
530 begin = from[name];
531 if (begin === undefined) {
532 begin = (name in customAttr && 'get' in customAttr[name]) ?
533 customAttr[name].get(this, name) : Y.Anim.DEFAULT_GETTER(this, name);
534 } else if (typeof begin === 'function') {
535 begin = begin.call(this, node);
536 }
537
538 var mFrom = Y.Anim.RE_UNITS.exec(begin);
539 var mTo = Y.Anim.RE_UNITS.exec(val);
540
541 begin = mFrom ? mFrom[1] : begin;
542 var end = mTo ? mTo[1] : val,
543 unit = mTo ? mTo[2] : mFrom ? mFrom[2] : ''; // one might be zero TODO: mixed units
544
545 if (!unit && Y.Anim.RE_DEFAULT_UNIT.test(name)) {
546 unit = Y.Anim.DEFAULT_UNIT;
547 }
548
549 if (!begin || !end) {
550 Y.fail('invalid "from" or "to" for "' + name + '"', 'Anim');
551 return;
552 }
553
554 attr[name] = {
555 from: begin,
556 to: end,
557 unit: unit
558 };
559
560 attr.duration = dur;
561 attr.easing = easing;
562
563 }, this);
564
565 this._runtimeAttr = attr;
566 },
567
568
569 // TODO: move to computedStyle? (browsers dont agree on default computed offsets)
570 _getOffset: function(attr) {
571 var node = this._node,
572 val = node.getComputedStyle(attr),
573 get = (attr === 'left') ? 'getX': 'getY',
574 set = (attr === 'left') ? 'setX': 'setY';
575
576 if (val === 'auto') {
577 var position = node.getStyle('position');
578 if (position === 'absolute' || position === 'fixed') {
579 val = node[get]();
580 node[set](val);
581 } else {
582 val = 0;
583 }
584 }
585
586 return val;
587 }
588 };
589
590 Y.extend(Y.Anim, Y.Base, proto);
591
592
593}, '3.0.0pr2' ,{requires:['base', 'node']});
5940
=== removed file 'src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-color-debug.js'
--- src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-color-debug.js 2008-12-15 13:29:08 +0000
+++ src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-color-debug.js 1970-01-01 00:00:00 +0000
@@ -1,55 +0,0 @@
1/*
2Copyright (c) 2008, Yahoo! Inc. All rights reserved.
3Code licensed under the BSD License:
4http://developer.yahoo.net/yui/license.txt
5version: 3.0.0pr2
6*/
7YUI.add('anim-color', function(Y) {
8
9/**
10 * Adds support for color properties in <code>to</code>
11 * and <code>from</code> attributes.
12 * @module anim
13 * @submodule anim-color
14 * @for Anim
15 */
16
17var NUM = Number;
18
19Y.Anim.behaviors.color = {
20 set: function(anim, att, from, to, elapsed, duration, fn) {
21 from = Y.Color.re_RGB.exec(Y.Color.toRGB(from));
22 to = Y.Color.re_RGB.exec(Y.Color.toRGB(to));
23
24 if (!from || from.length < 3 || !to || to.length < 3) {
25 Y.fail('invalid from or to passed to color behavior');
26 }
27
28 anim._node.setStyle(att, 'rgb(' + [
29 Math.floor(fn(elapsed, NUM(from[1]), NUM(to[1]) - NUM(from[1]), duration)),
30 Math.floor(fn(elapsed, NUM(from[2]), NUM(to[2]) - NUM(from[2]), duration)),
31 Math.floor(fn(elapsed, NUM(from[3]), NUM(to[3]) - NUM(from[3]), duration))
32 ].join(', ') + ')');
33 },
34
35 // TODO: default bgcolor const
36 get: function(anim, att) {
37 var val = anim._node.getComputedStyle(att);
38 val = (val === 'transparent') ? 'rgb(255, 255, 255)' : val;
39 return val;
40 }
41};
42
43Y.each(['backgroundColor',
44 'borderColor',
45 'borderTopColor',
46 'borderRightColor',
47 'borderBottomColor',
48 'borderLeftColor'],
49 function(v, i) {
50 Y.Anim.behaviors[v] = Y.Anim.behaviors.color;
51 }
52);
53
54
55}, '3.0.0pr2' ,{requires:['anim-base', 'node-style']});
560
=== removed file 'src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-color-min.js'
--- src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-color-min.js 2008-12-15 13:29:08 +0000
+++ src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-color-min.js 1970-01-01 00:00:00 +0000
@@ -1,7 +0,0 @@
1/*
2Copyright (c) 2008, Yahoo! Inc. All rights reserved.
3Code licensed under the BSD License:
4http://developer.yahoo.net/yui/license.txt
5version: 3.0.0pr2
6*/
7YUI.add("anim-color",function(B){var A=Number;B.Anim.behaviors.color={set:function(F,D,I,H,C,G,E){I=B.Color.re_RGB.exec(B.Color.toRGB(I));H=B.Color.re_RGB.exec(B.Color.toRGB(H));if(!I||I.length<3||!H||H.length<3){B.fail("invalid from or to passed to color behavior");}F._node.setStyle(D,"rgb("+[Math.floor(E(C,A(I[1]),A(H[1])-A(I[1]),G)),Math.floor(E(C,A(I[2]),A(H[2])-A(I[2]),G)),Math.floor(E(C,A(I[3]),A(H[3])-A(I[3]),G))].join(", ")+")");},get:function(D,C){var E=D._node.getComputedStyle(C);E=(E==="transparent")?"rgb(255, 255, 255)":E;return E;}};B.each(["backgroundColor","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"],function(C,D){B.Anim.behaviors[C]=B.Anim.behaviors.color;});},"3.0.0pr2",{requires:["anim-base","node-style"]});
8\ No newline at end of file0\ No newline at end of file
91
=== removed file 'src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-color.js'
--- src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-color.js 2008-12-15 13:29:08 +0000
+++ src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-color.js 1970-01-01 00:00:00 +0000
@@ -1,55 +0,0 @@
1/*
2Copyright (c) 2008, Yahoo! Inc. All rights reserved.
3Code licensed under the BSD License:
4http://developer.yahoo.net/yui/license.txt
5version: 3.0.0pr2
6*/
7YUI.add('anim-color', function(Y) {
8
9/**
10 * Adds support for color properties in <code>to</code>
11 * and <code>from</code> attributes.
12 * @module anim
13 * @submodule anim-color
14 * @for Anim
15 */
16
17var NUM = Number;
18
19Y.Anim.behaviors.color = {
20 set: function(anim, att, from, to, elapsed, duration, fn) {
21 from = Y.Color.re_RGB.exec(Y.Color.toRGB(from));
22 to = Y.Color.re_RGB.exec(Y.Color.toRGB(to));
23
24 if (!from || from.length < 3 || !to || to.length < 3) {
25 Y.fail('invalid from or to passed to color behavior');
26 }
27
28 anim._node.setStyle(att, 'rgb(' + [
29 Math.floor(fn(elapsed, NUM(from[1]), NUM(to[1]) - NUM(from[1]), duration)),
30 Math.floor(fn(elapsed, NUM(from[2]), NUM(to[2]) - NUM(from[2]), duration)),
31 Math.floor(fn(elapsed, NUM(from[3]), NUM(to[3]) - NUM(from[3]), duration))
32 ].join(', ') + ')');
33 },
34
35 // TODO: default bgcolor const
36 get: function(anim, att) {
37 var val = anim._node.getComputedStyle(att);
38 val = (val === 'transparent') ? 'rgb(255, 255, 255)' : val;
39 return val;
40 }
41};
42
43Y.each(['backgroundColor',
44 'borderColor',
45 'borderTopColor',
46 'borderRightColor',
47 'borderBottomColor',
48 'borderLeftColor'],
49 function(v, i) {
50 Y.Anim.behaviors[v] = Y.Anim.behaviors.color;
51 }
52);
53
54
55}, '3.0.0pr2' ,{requires:['anim-base', 'node-style']});
560
=== removed file 'src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-curve-debug.js'
--- src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-curve-debug.js 2008-12-15 13:29:08 +0000
+++ src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-curve-debug.js 1970-01-01 00:00:00 +0000
@@ -1,63 +0,0 @@
1/*
2Copyright (c) 2008, Yahoo! Inc. All rights reserved.
3Code licensed under the BSD License:
4http://developer.yahoo.net/yui/license.txt
5version: 3.0.0pr2
6*/
7YUI.add('anim-curve', function(Y) {
8
9/**
10 * Adds support for the <code>curve</code> property for the <code>to</code>
11 * attribute. A curve is zero or more control points and an end point.
12 * @module anim
13 * @submodule anim-curve
14 * @for Anim
15 */
16
17Y.Anim.behaviors.curve = {
18 set: function(anim, att, from, to, elapsed, duration, fn) {
19 from = from.slice.call(from);
20 to = to.slice.call(to);
21 var t = fn(elapsed, 0, 100, duration) / 100;
22 to.unshift(from);
23 anim._node.setXY(Y.Anim.getBezier(to, t));
24 },
25
26 get: function(anim, att) {
27 return anim._node.getXY();
28 }
29};
30
31/**
32 * Get the current position of the animated element based on t.
33 * Each point is an array of "x" and "y" values (0 = x, 1 = y)
34 * At least 2 points are required (start and end).
35 * First point is start. Last point is end.
36 * Additional control points are optional.
37 * @method getBezier
38 * @static
39 * @param {Array} points An array containing Bezier points
40 * @param {Number} t A number between 0 and 1 which is the basis for determining current position
41 * @return {Array} An array containing int x and y member data
42 */
43Y.Anim.getBezier = function(points, t) {
44 var n = points.length;
45 var tmp = [];
46
47 for (var i = 0; i < n; ++i){
48 tmp[i] = [points[i][0], points[i][1]]; // save input
49 }
50
51 for (var j = 1; j < n; ++j) {
52 for (i = 0; i < n - j; ++i) {
53 tmp[i][0] = (1 - t) * tmp[i][0] + t * tmp[parseInt(i + 1, 10)][0];
54 tmp[i][1] = (1 - t) * tmp[i][1] + t * tmp[parseInt(i + 1, 10)][1];
55 }
56 }
57
58 return [ tmp[0][0], tmp[0][1] ];
59
60};
61
62
63}, '3.0.0pr2' ,{requires:['anim-base', 'node-screen']});
640
=== removed file 'src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-curve-min.js'
--- src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-curve-min.js 2008-12-15 13:29:08 +0000
+++ src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-curve-min.js 1970-01-01 00:00:00 +0000
@@ -1,7 +0,0 @@
1/*
2Copyright (c) 2008, Yahoo! Inc. All rights reserved.
3Code licensed under the BSD License:
4http://developer.yahoo.net/yui/license.txt
5version: 3.0.0pr2
6*/
7YUI.add("anim-curve",function(A){A.Anim.behaviors.curve={set:function(F,C,I,H,B,G,E){I=I.slice.call(I);H=H.slice.call(H);var D=E(B,0,100,G)/100;H.unshift(I);F._node.setXY(A.Anim.getBezier(H,D));},get:function(C,B){return C._node.getXY();}};A.Anim.getBezier=function(F,E){var G=F.length;var D=[];for(var C=0;C<G;++C){D[C]=[F[C][0],F[C][1]];}for(var B=1;B<G;++B){for(C=0;C<G-B;++C){D[C][0]=(1-E)*D[C][0]+E*D[parseInt(C+1,10)][0];D[C][1]=(1-E)*D[C][1]+E*D[parseInt(C+1,10)][1];}}return[D[0][0],D[0][1]];};},"3.0.0pr2",{requires:["anim-base","node-screen"]});
8\ No newline at end of file0\ No newline at end of file
91
=== removed file 'src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-curve.js'
--- src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-curve.js 2008-12-15 13:29:08 +0000
+++ src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-curve.js 1970-01-01 00:00:00 +0000
@@ -1,63 +0,0 @@
1/*
2Copyright (c) 2008, Yahoo! Inc. All rights reserved.
3Code licensed under the BSD License:
4http://developer.yahoo.net/yui/license.txt
5version: 3.0.0pr2
6*/
7YUI.add('anim-curve', function(Y) {
8
9/**
10 * Adds support for the <code>curve</code> property for the <code>to</code>
11 * attribute. A curve is zero or more control points and an end point.
12 * @module anim
13 * @submodule anim-curve
14 * @for Anim
15 */
16
17Y.Anim.behaviors.curve = {
18 set: function(anim, att, from, to, elapsed, duration, fn) {
19 from = from.slice.call(from);
20 to = to.slice.call(to);
21 var t = fn(elapsed, 0, 100, duration) / 100;
22 to.unshift(from);
23 anim._node.setXY(Y.Anim.getBezier(to, t));
24 },
25
26 get: function(anim, att) {
27 return anim._node.getXY();
28 }
29};
30
31/**
32 * Get the current position of the animated element based on t.
33 * Each point is an array of "x" and "y" values (0 = x, 1 = y)
34 * At least 2 points are required (start and end).
35 * First point is start. Last point is end.
36 * Additional control points are optional.
37 * @method getBezier
38 * @static
39 * @param {Array} points An array containing Bezier points
40 * @param {Number} t A number between 0 and 1 which is the basis for determining current position
41 * @return {Array} An array containing int x and y member data
42 */
43Y.Anim.getBezier = function(points, t) {
44 var n = points.length;
45 var tmp = [];
46
47 for (var i = 0; i < n; ++i){
48 tmp[i] = [points[i][0], points[i][1]]; // save input
49 }
50
51 for (var j = 1; j < n; ++j) {
52 for (i = 0; i < n - j; ++i) {
53 tmp[i][0] = (1 - t) * tmp[i][0] + t * tmp[parseInt(i + 1, 10)][0];
54 tmp[i][1] = (1 - t) * tmp[i][1] + t * tmp[parseInt(i + 1, 10)][1];
55 }
56 }
57
58 return [ tmp[0][0], tmp[0][1] ];
59
60};
61
62
63}, '3.0.0pr2' ,{requires:['anim-base', 'node-screen']});
640
=== removed file 'src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-debug.js'
--- src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-debug.js 2008-12-15 13:29:08 +0000
+++ src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-debug.js 1970-01-01 00:00:00 +0000
@@ -1,1106 +0,0 @@
1/*
2Copyright (c) 2008, Yahoo! Inc. All rights reserved.
3Code licensed under the BSD License:
4http://developer.yahoo.net/yui/license.txt
5version: 3.0.0pr2
6*/
7YUI.add('anim', function(Y) {
8
9/**
10 * Y.Animation Utility.
11 * @module anim
12 */
13
14 /**
15 * Handles animation _queueing and threading.
16 * @class Anim
17 * @constructor
18 * @extends Base
19 */
20
21 var RUNNING = 'running',
22 START_TIME = 'startTime',
23 ELAPSED_TIME = 'elapsedTime',
24 /**
25 * @event start
26 * @description fires when an animation begins.
27 * @param {Event} ev The start event.
28 * @type Event.Custom
29 */
30 START = 'start',
31
32 /**
33 * @event tween
34 * @description fires every frame of the animation.
35 * @param {Event} ev The tween event.
36 * @type Event.Custom
37 */
38 TWEEN = 'tween',
39
40 /**
41 * @event end
42 * @description fires after the animation completes.
43 * @param {Event} ev The end event.
44 * @type Event.Custom
45 */
46 END = 'end',
47 NODE = 'node',
48 PAUSED = 'paused',
49 REVERSE = 'reverse', // TODO: cleanup
50 ITERATION_COUNT = 'iterationCount',
51
52 NUM = Number;
53
54 var _running = {},
55 _instances = {},
56 _timer;
57
58 Y.Anim = function() {
59 Y.Anim.superclass.constructor.apply(this, arguments);
60 _instances[Y.stamp(this)] = this;
61 };
62
63 Y.Anim.NAME = 'anim';
64
65 /**
66 * Regex of properties that should use the default unit.
67 *
68 * @property RE_DEFAULT_UNIT
69 * @static
70 */
71 Y.Anim.RE_DEFAULT_UNIT = /^width|height|top|right|bottom|left|margin.*|padding.*|border.*$/i;
72
73 /**
74 * The default unit to use with properties that pass the RE_DEFAULT_UNIT test.
75 *
76 * @property DEFAULT_UNIT
77 * @static
78 */
79 Y.Anim.DEFAULT_UNIT = 'px';
80
81 Y.Anim.DEFAULT_EASING = function (t, b, c, d) {
82 return c * t / d + b; // linear easing
83 };
84
85 /**
86 * Bucket for custom getters and setters
87 *
88 * @property behaviors
89 * @static
90 */
91 Y.Anim.behaviors = {
92 left: {
93 get: function(anim, attr) {
94 return anim._getOffset(attr);
95 }
96 }
97 };
98
99 Y.Anim.behaviors.top = Y.Anim.behaviors.left;
100
101 /**
102 * The default setter to use when setting object properties.
103 *
104 * @property DEFAULT_SETTER
105 * @static
106 */
107 Y.Anim.DEFAULT_SETTER = function(anim, att, from, to, elapsed, duration, fn, unit) {
108 unit = unit || '';
109 anim._node.setStyle(att, fn(elapsed, NUM(from), NUM(to) - NUM(from), duration) + unit);
110 };
111
112 /**
113 * The default getter to use when getting object properties.
114 *
115 * @property DEFAULT_GETTER
116 * @static
117 */
118 Y.Anim.DEFAULT_GETTER = function(anim, prop) {
119 return anim._node.getComputedStyle(prop);
120 };
121
122 Y.Anim.ATTRS = {
123 /**
124 * The object to be animated.
125 * @attribute node
126 * @type Node
127 */
128 node: {
129 set: function(node) {
130 node = Y.Node.get(node);
131 this._node = node;
132 if (!node) {
133 Y.fail('Y.Anim: invalid node: ' + node);
134 }
135 return node;
136 }
137 },
138
139 /**
140 * The length of the animation. Defaults to "1" (second).
141 * @attribute duration
142 * @type NUM
143 */
144 duration: {
145 value: 1
146 },
147
148 /**
149 * The method that will provide values to the attribute(s) during the animation.
150 * Defaults to "Easing.easeNone".
151 * @attribute easing
152 * @type Function
153 */
154 easing: {
155 value: Y.Anim.DEFAULT_EASING,
156
157 set: function(val) {
158 if (typeof val === 'string' && Y.Easing) {
159 return Y.Easing[val];
160 }
161 }
162 },
163
164 /**
165 * The starting values for the animated properties.
166 * Fields may be strings, numbers, or functions.
167 * If a function is used, the return value becomes the from value.
168 * If no from value is specified, the DEFAULT_GETTER will be used.
169 * @attribute from
170 * @type Object
171 */
172 from: {},
173
174 /**
175 * The ending values for the animated properties.
176 * Fields may be strings, numbers, or functions.
177 * @attribute to
178 * @type Object
179 */
180 to: {},
181
182 /**
183 * Date stamp for the first frame of the animation.
184 * @attribute startTime
185 * @type Int
186 * @default 0
187 * @readOnly
188 */
189 startTime: {
190 value: 0,
191 readOnly: true
192 },
193
194 /**
195 * Current time the animation has been running.
196 * @attribute elapsedTime
197 * @type Int
198 * @default 0
199 * @readOnly
200 */
201 elapsedTime: {
202 value: 0,
203 readOnly: true
204 },
205
206 /**
207 * Whether or not the animation is currently running.
208 * @attribute running
209 * @type Boolean
210 * @default false
211 * @readOnly
212 */
213 running: {
214 get: function() {
215 return !!_running[Y.stamp(this)];
216 },
217 value: false,
218 readOnly: true
219 },
220
221 /**
222 * The number of times the animation should run
223 * @attribute iterations
224 * @type Int
225 * @default 1
226 */
227 iterations: {
228 value: 1
229 },
230
231 /**
232 * The number of iterations that have occurred.
233 * Resets when an animation ends (reaches iteration count or stop() called).
234 * @attribute iterationCount
235 * @type Int
236 * @default 0
237 * @readOnly
238 */
239 iterationCount: {
240 value: 0,
241 readOnly: true
242 },
243
244 /**
245 * How iterations of the animation should behave.
246 * Possible values are "normal" and "alternate".
247 * Normal will repeat the animation, alternate will reverse on every other pass.
248 *
249 * @attribute direction
250 * @type String
251 * @default "normal"
252 */
253 direction: {
254 value: 'normal' // | alternate (fwd on odd, rev on even per spec)
255 },
256
257 /**
258 * Whether or not the animation is currently paused.
259 * @attribute running
260 * @type Boolean
261 * @default false
262 * @readOnly
263 */
264 paused: {
265 readOnly: true,
266 value: false
267 },
268
269 /**
270 * If true, animation begins from last frame
271 * @attribute reverse
272 * @type Boolean
273 * @default false
274 */
275 reverse: {
276 value: false
277 }
278
279
280 };
281
282 /**
283 * Runs all animation instances.
284 * @method run
285 * @static
286 */
287 Y.Anim.run = function() {
288 for (var i in _instances) {
289 if (_instances[i].run) {
290 _instances[i].run();
291 }
292 }
293 };
294
295 /**
296 * Pauses all animation instances.
297 * @method pause
298 * @static
299 */
300 Y.Anim.pause = function() {
301 for (var i in _running) { // stop timer if nothing running
302 if (_running[i].pause) {
303 _running[i].pause();
304 }
305 }
306 Y.Anim._stopTimer();
307 };
308
309 /**
310 * Stops all animation instances.
311 * @method stop
312 * @static
313 */
314 Y.Anim.stop = function() {
315 for (var i in _running) { // stop timer if nothing running
316 if (_running[i].stop) {
317 _running[i].stop();
318 }
319 }
320 Y.Anim._stopTimer();
321 };
322
323 Y.Anim._startTimer = function() {
324 if (!_timer) {
325 _timer = setInterval(Y.Anim._runFrame, 1);
326 }
327 };
328
329 Y.Anim._stopTimer = function() {
330 clearInterval(_timer);
331 _timer = 0;
332 };
333
334 /**
335 * Called per Interval to handle each animation frame.
336 * @method _runFrame
337 * @private
338 * @static
339 */
340 Y.Anim._runFrame = function() {
341 var done = true;
342 for (var anim in _running) {
343 if (_running[anim]._runFrame) {
344 done = false;
345 _running[anim]._runFrame();
346 }
347 }
348
349 if (done) {
350 Y.Anim._stopTimer();
351 }
352 };
353
354 Y.Anim.RE_UNITS = /^(-?\d*\.?\d*){1}(em|ex|px|in|cm|mm|pt|pc|%)*$/;
355
356 var proto = {
357 /**
358 * Starts or resumes an animation.
359 * percent start time marker.
360 * @method run
361 * @chainable
362 */
363 run: function() {
364 if (!this.get(RUNNING)) {
365 this._start();
366 } else if (this.get(PAUSED)) {
367 this._resume();
368 }
369 return this;
370 },
371
372 /**
373 * Pauses the animation and
374 * freezes it in its current state and time.
375 * Calling run() will continue where it left off.
376 * @method pause
377 * @chainable
378 */
379 pause: function() {
380 if (this.get(RUNNING)) {
381 this._pause();
382 }
383 return this;
384 },
385
386 /**
387 * Stops the animation and resets its time.
388 * @method stop
389 * @chainable
390 */
391 stop: function(finish) {
392 if (this.get(RUNNING) || this.get(PAUSED)) {
393 this._end(finish);
394 }
395 return this;
396 },
397
398 _added: false,
399
400 _start: function() {
401 this._set(START_TIME, new Date() - this.get(ELAPSED_TIME));
402 this._actualFrames = 0;
403 if (!this.get(PAUSED)) {
404 this._initAttr();
405 }
406 _running[Y.stamp(this)] = this;
407 Y.Anim._startTimer();
408
409 this.fire(START);
410 },
411
412 _pause: function() {
413 this._set(START_TIME, null);
414 this._set(PAUSED, true);
415 delete _running[Y.stamp(this)];
416
417 /**
418 * @event pause
419 * @description fires when an animation is paused.
420 * @param {Event} ev The pause event.
421 * @type Event.Custom
422 */
423 this.fire('pause');
424 },
425
426 _resume: function() {
427 this._set(PAUSED, false);
428 _running[Y.stamp(this)] = this;
429
430 /**
431 * @event resume
432 * @description fires when an animation is resumed (run from pause).
433 * @param {Event} ev The pause event.
434 * @type Event.Custom
435 */
436 this.fire('resume');
437 },
438
439 _end: function(finish) {
440 this._set(START_TIME, null);
441 this._set(ELAPSED_TIME, 0);
442 this._set(PAUSED, false);
443
444 delete _running[Y.stamp(this)];
445 this.fire(END, {elapsed: this.get(ELAPSED_TIME)});
446 },
447
448 _runFrame: function() {
449 var attr = this._runtimeAttr,
450 customAttr = Y.Anim.behaviors,
451 easing = attr.easing,
452 d = attr.duration,
453 t = new Date() - this.get(START_TIME),
454 reversed = this.get(REVERSE),
455 done = (t >= d),
456 lastFrame = d,
457 attribute,
458 setter;
459
460 if (reversed) {
461 t = d - t;
462 done = (t <= 0);
463 lastFrame = 0;
464 }
465
466 for (var i in attr) {
467 if (attr[i].to) {
468 attribute = attr[i];
469 setter = (i in customAttr && 'set' in customAttr[i]) ?
470 customAttr[i].set : Y.Anim.DEFAULT_SETTER;
471
472 if (!done) {
473 setter(this, i, attribute.from, attribute.to, t, d, easing, attribute.unit);
474 } else { // ensure final frame value is set
475 // TODO: handle keyframes
476 setter(this, i, attribute.from, attribute.to, lastFrame, d, easing, attribute.unit);
477 }
478 }
479 }
480
481 this._actualFrames += 1;
482 this._set(ELAPSED_TIME, t);
483
484 this.fire(TWEEN);
485 if (done) {
486 this._lastFrame();
487 }
488 },
489
490 _lastFrame: function() {
491 var iter = this.get('iterations'),
492 iterCount = this.get(ITERATION_COUNT);
493
494 iterCount += 1;
495 if (iter === 'infinite' || iterCount < iter) {
496 if (this.get('direction') === 'alternate') {
497 this.set(REVERSE, !this.get(REVERSE)); // flip it
498 }
499 /**
500 * @event iteration
501 * @description fires when an animation begins an iteration.
502 * @param {Event} ev The iteration event.
503 * @type Event.Custom
504 */
505 this.fire('iteration');
506 } else {
507 iterCount = 0;
508 this._end();
509 }
510
511 this._set(START_TIME, new Date());
512 this._set(ITERATION_COUNT, iterCount);
513 },
514
515 _initAttr: function() {
516 var from = this.get('from') || {},
517 to = this.get('to') || {},
518 dur = this.get('duration') * 1000,
519 node = this.get(NODE),
520 easing = this.get('easing') || {},
521 attr = {},
522 customAttr = Y.Anim.behaviors,
523 unit, begin, end;
524
525 Y.each(to, function(val, name) {
526 if (typeof val === 'function') {
527 val = val.call(this, node);
528 }
529
530 begin = from[name];
531 if (begin === undefined) {
532 begin = (name in customAttr && 'get' in customAttr[name]) ?
533 customAttr[name].get(this, name) : Y.Anim.DEFAULT_GETTER(this, name);
534 } else if (typeof begin === 'function') {
535 begin = begin.call(this, node);
536 }
537
538 var mFrom = Y.Anim.RE_UNITS.exec(begin);
539 var mTo = Y.Anim.RE_UNITS.exec(val);
540
541 begin = mFrom ? mFrom[1] : begin;
542 var end = mTo ? mTo[1] : val,
543 unit = mTo ? mTo[2] : mFrom ? mFrom[2] : ''; // one might be zero TODO: mixed units
544
545 if (!unit && Y.Anim.RE_DEFAULT_UNIT.test(name)) {
546 unit = Y.Anim.DEFAULT_UNIT;
547 }
548
549 if (!begin || !end) {
550 Y.fail('invalid "from" or "to" for "' + name + '"', 'Anim');
551 return;
552 }
553
554 attr[name] = {
555 from: begin,
556 to: end,
557 unit: unit
558 };
559
560 attr.duration = dur;
561 attr.easing = easing;
562
563 }, this);
564
565 this._runtimeAttr = attr;
566 },
567
568
569 // TODO: move to computedStyle? (browsers dont agree on default computed offsets)
570 _getOffset: function(attr) {
571 var node = this._node,
572 val = node.getComputedStyle(attr),
573 get = (attr === 'left') ? 'getX': 'getY',
574 set = (attr === 'left') ? 'setX': 'setY';
575
576 if (val === 'auto') {
577 var position = node.getStyle('position');
578 if (position === 'absolute' || position === 'fixed') {
579 val = node[get]();
580 node[set](val);
581 } else {
582 val = 0;
583 }
584 }
585
586 return val;
587 }
588 };
589
590 Y.extend(Y.Anim, Y.Base, proto);
591/*
592TERMS OF USE - EASING EQUATIONS
593Open source under the BSD License.
594Copyright 2001 Robert Penner All rights reserved.
595
596Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
597
598 * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
599 * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
600 * Neither the name of the author nor the names of contributors may be used to endorse or promote products derived from this software without specific prior written permission.
601
602THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
603*/
604
605/**
606 * The easing module provides methods for customizing
607 * how an animation behaves during each run.
608 * @class Easing
609 * @module anim
610 * @submodule anim-easing
611 */
612
613Y.Easing = {
614
615 /**
616 * Uniform speed between points.
617 * @method easeNone
618 * @param {Number} t Time value used to compute current value
619 * @param {Number} b Starting value
620 * @param {Number} c Delta between start and end values
621 * @param {Number} d Total length of animation
622 * @return {Number} The computed value for the current animation frame
623 */
624 easeNone: function (t, b, c, d) {
625 return c*t/d + b;
626 },
627
628 /**
629 * Begins slowly and accelerates towards end. (quadratic)
630 * @method easeIn
631 * @param {Number} t Time value used to compute current value
632 * @param {Number} b Starting value
633 * @param {Number} c Delta between start and end values
634 * @param {Number} d Total length of animation
635 * @return {Number} The computed value for the current animation frame
636 */
637 easeIn: function (t, b, c, d) {
638 return c*(t/=d)*t + b;
639 },
640
641 /**
642 * Begins quickly and decelerates towards end. (quadratic)
643 * @method easeOut
644 * @param {Number} t Time value used to compute current value
645 * @param {Number} b Starting value
646 * @param {Number} c Delta between start and end values
647 * @param {Number} d Total length of animation
648 * @return {Number} The computed value for the current animation frame
649 */
650 easeOut: function (t, b, c, d) {
651 return -c *(t/=d)*(t-2) + b;
652 },
653
654 /**
655 * Begins slowly and decelerates towards end. (quadratic)
656 * @method easeBoth
657 * @param {Number} t Time value used to compute current value
658 * @param {Number} b Starting value
659 * @param {Number} c Delta between start and end values
660 * @param {Number} d Total length of animation
661 * @return {Number} The computed value for the current animation frame
662 */
663 easeBoth: function (t, b, c, d) {
664 if ((t/=d/2) < 1) {
665 return c/2*t*t + b;
666 }
667
668 return -c/2 * ((--t)*(t-2) - 1) + b;
669 },
670
671 /**
672 * Begins slowly and accelerates towards end. (quartic)
673 * @method easeInStrong
674 * @param {Number} t Time value used to compute current value
675 * @param {Number} b Starting value
676 * @param {Number} c Delta between start and end values
677 * @param {Number} d Total length of animation
678 * @return {Number} The computed value for the current animation frame
679 */
680 easeInStrong: function (t, b, c, d) {
681 return c*(t/=d)*t*t*t + b;
682 },
683
684 /**
685 * Begins quickly and decelerates towards end. (quartic)
686 * @method easeOutStrong
687 * @param {Number} t Time value used to compute current value
688 * @param {Number} b Starting value
689 * @param {Number} c Delta between start and end values
690 * @param {Number} d Total length of animation
691 * @return {Number} The computed value for the current animation frame
692 */
693 easeOutStrong: function (t, b, c, d) {
694 return -c * ((t=t/d-1)*t*t*t - 1) + b;
695 },
696
697 /**
698 * Begins slowly and decelerates towards end. (quartic)
699 * @method easeBothStrong
700 * @param {Number} t Time value used to compute current value
701 * @param {Number} b Starting value
702 * @param {Number} c Delta between start and end values
703 * @param {Number} d Total length of animation
704 * @return {Number} The computed value for the current animation frame
705 */
706 easeBothStrong: function (t, b, c, d) {
707 if ((t/=d/2) < 1) {
708 return c/2*t*t*t*t + b;
709 }
710
711 return -c/2 * ((t-=2)*t*t*t - 2) + b;
712 },
713
714 /**
715 * Snap in elastic effect.
716 * @method elasticIn
717 * @param {Number} t Time value used to compute current value
718 * @param {Number} b Starting value
719 * @param {Number} c Delta between start and end values
720 * @param {Number} d Total length of animation
721 * @param {Number} a Amplitude (optional)
722 * @param {Number} p Period (optional)
723 * @return {Number} The computed value for the current animation frame
724 */
725
726 elasticIn: function (t, b, c, d, a, p) {
727 var s;
728 if (t === 0) {
729 return b;
730 }
731 if ( (t /= d) === 1 ) {
732 return b+c;
733 }
734 if (!p) {
735 p = d* 0.3;
736 }
737
738 if (!a || a < Math.abs(c)) {
739 a = c;
740 s = p/4;
741 }
742 else {
743 s = p/(2*Math.PI) * Math.asin (c/a);
744 }
745
746 return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
747 },
748
749 /**
750 * Snap out elastic effect.
751 * @method elasticOut
752 * @param {Number} t Time value used to compute current value
753 * @param {Number} b Starting value
754 * @param {Number} c Delta between start and end values
755 * @param {Number} d Total length of animation
756 * @param {Number} a Amplitude (optional)
757 * @param {Number} p Period (optional)
758 * @return {Number} The computed value for the current animation frame
759 */
760 elasticOut: function (t, b, c, d, a, p) {
761 var s;
762 if (t === 0) {
763 return b;
764 }
765 if ( (t /= d) === 1 ) {
766 return b+c;
767 }
768 if (!p) {
769 p=d * 0.3;
770 }
771
772 if (!a || a < Math.abs(c)) {
773 a = c;
774 s = p / 4;
775 }
776 else {
777 s = p/(2*Math.PI) * Math.asin (c/a);
778 }
779
780 return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;
781 },
782
783 /**
784 * Snap both elastic effect.
785 * @method elasticBoth
786 * @param {Number} t Time value used to compute current value
787 * @param {Number} b Starting value
788 * @param {Number} c Delta between start and end values
789 * @param {Number} d Total length of animation
790 * @param {Number} a Amplitude (optional)
791 * @param {Number} p Period (optional)
792 * @return {Number} The computed value for the current animation frame
793 */
794 elasticBoth: function (t, b, c, d, a, p) {
795 var s;
796 if (t === 0) {
797 return b;
798 }
799
800 if ( (t /= d/2) === 2 ) {
801 return b+c;
802 }
803
804 if (!p) {
805 p = d*(0.3*1.5);
806 }
807
808 if ( !a || a < Math.abs(c) ) {
809 a = c;
810 s = p/4;
811 }
812 else {
813 s = p/(2*Math.PI) * Math.asin (c/a);
814 }
815
816 if (t < 1) {
817 return -0.5*(a*Math.pow(2,10*(t-=1)) *
818 Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
819 }
820 return a*Math.pow(2,-10*(t-=1)) *
821 Math.sin( (t*d-s)*(2*Math.PI)/p )*0.5 + c + b;
822 },
823
824
825 /**
826 * Backtracks slightly, then reverses direction and moves to end.
827 * @method backIn
828 * @param {Number} t Time value used to compute current value
829 * @param {Number} b Starting value
830 * @param {Number} c Delta between start and end values
831 * @param {Number} d Total length of animation
832 * @param {Number} s Overshoot (optional)
833 * @return {Number} The computed value for the current animation frame
834 */
835 backIn: function (t, b, c, d, s) {
836 if (s == undefined) {
837 s = 1.70158;
838 }
839 if (t === d) {
840 t -= 0.001;
841 }
842 return c*(t/=d)*t*((s+1)*t - s) + b;
843 },
844
845 /**
846 * Overshoots end, then reverses and comes back to end.
847 * @method backOut
848 * @param {Number} t Time value used to compute current value
849 * @param {Number} b Starting value
850 * @param {Number} c Delta between start and end values
851 * @param {Number} d Total length of animation
852 * @param {Number} s Overshoot (optional)
853 * @return {Number} The computed value for the current animation frame
854 */
855 backOut: function (t, b, c, d, s) {
856 if (typeof s === 'undefined') {
857 s = 1.70158;
858 }
859 return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;
860 },
861
862 /**
863 * Backtracks slightly, then reverses direction, overshoots end,
864 * then reverses and comes back to end.
865 * @method backBoth
866 * @param {Number} t Time value used to compute current value
867 * @param {Number} b Starting value
868 * @param {Number} c Delta between start and end values
869 * @param {Number} d Total length of animation
870 * @param {Number} s Overshoot (optional)
871 * @return {Number} The computed value for the current animation frame
872 */
873 backBoth: function (t, b, c, d, s) {
874 if (typeof s === 'undefined') {
875 s = 1.70158;
876 }
877
878 if ((t /= d/2 ) < 1) {
879 return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
880 }
881 return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
882 },
883
884 /**
885 * Bounce off of start.
886 * @method bounceIn
887 * @param {Number} t Time value used to compute current value
888 * @param {Number} b Starting value
889 * @param {Number} c Delta between start and end values
890 * @param {Number} d Total length of animation
891 * @return {Number} The computed value for the current animation frame
892 */
893 bounceIn: function (t, b, c, d) {
894 return c - Y.Easing.bounceOut(d-t, 0, c, d) + b;
895 },
896
897 /**
898 * Bounces off end.
899 * @method bounceOut
900 * @param {Number} t Time value used to compute current value
901 * @param {Number} b Starting value
902 * @param {Number} c Delta between start and end values
903 * @param {Number} d Total length of animation
904 * @return {Number} The computed value for the current animation frame
905 */
906 bounceOut: function (t, b, c, d) {
907 if ((t/=d) < (1/2.75)) {
908 return c*(7.5625*t*t) + b;
909 } else if (t < (2/2.75)) {
910 return c*(7.5625*(t-=(1.5/2.75))*t + 0.75) + b;
911 } else if (t < (2.5/2.75)) {
912 return c*(7.5625*(t-=(2.25/2.75))*t + 0.9375) + b;
913 }
914 return c*(7.5625*(t-=(2.625/2.75))*t + 0.984375) + b;
915 },
916
917 /**
918 * Bounces off start and end.
919 * @method bounceBoth
920 * @param {Number} t Time value used to compute current value
921 * @param {Number} b Starting value
922 * @param {Number} c Delta between start and end values
923 * @param {Number} d Total length of animation
924 * @return {Number} The computed value for the current animation frame
925 */
926 bounceBoth: function (t, b, c, d) {
927 if (t < d/2) {
928 return Y.Easing.bounceIn(t * 2, 0, c, d) * 0.5 + b;
929 }
930 return Y.Easing.bounceOut(t * 2 - d, 0, c, d) * 0.5 + c * 0.5 + b;
931 }
932};
933/**
934 * Adds support for the <code>xy</code> property in <code>from</code> and
935 * <code>to</code> attributes.
936 * @module anim
937 * @submodule anim-xy
938 * @for Anim
939 */
940
941var NUM = Number;
942
943Y.Anim.behaviors.xy = {
944 set: function(anim, att, from, to, elapsed, duration, fn) {
945 anim._node.setXY([
946 fn(elapsed, NUM(from[0]), NUM(to[0]) - NUM(from[0]), duration),
947 fn(elapsed, NUM(from[1]), NUM(to[1]) - NUM(from[1]), duration)
948 ]);
949 },
950 get: function(anim) {
951 return anim._node.getXY();
952 }
953};
954
955/**
956 * Adds support for color properties in <code>to</code>
957 * and <code>from</code> attributes.
958 * @module anim
959 * @submodule anim-color
960 * @for Anim
961 */
962
963var NUM = Number;
964
965Y.Anim.behaviors.color = {
966 set: function(anim, att, from, to, elapsed, duration, fn) {
967 from = Y.Color.re_RGB.exec(Y.Color.toRGB(from));
968 to = Y.Color.re_RGB.exec(Y.Color.toRGB(to));
969
970 if (!from || from.length < 3 || !to || to.length < 3) {
971 Y.fail('invalid from or to passed to color behavior');
972 }
973
974 anim._node.setStyle(att, 'rgb(' + [
975 Math.floor(fn(elapsed, NUM(from[1]), NUM(to[1]) - NUM(from[1]), duration)),
976 Math.floor(fn(elapsed, NUM(from[2]), NUM(to[2]) - NUM(from[2]), duration)),
977 Math.floor(fn(elapsed, NUM(from[3]), NUM(to[3]) - NUM(from[3]), duration))
978 ].join(', ') + ')');
979 },
980
981 // TODO: default bgcolor const
982 get: function(anim, att) {
983 var val = anim._node.getComputedStyle(att);
984 val = (val === 'transparent') ? 'rgb(255, 255, 255)' : val;
985 return val;
986 }
987};
988
989Y.each(['backgroundColor',
990 'borderColor',
991 'borderTopColor',
992 'borderRightColor',
993 'borderBottomColor',
994 'borderLeftColor'],
995 function(v, i) {
996 Y.Anim.behaviors[v] = Y.Anim.behaviors.color;
997 }
998);
999/**
1000 * Adds support for the <code>scroll</code> property in <code>to</code>
1001 * and <code>from</code> attributes.
1002 * @module anim
1003 * @submodule anim-scroll
1004 * @for Anim
1005 */
1006
1007var NUM = Number;
1008
1009Y.Anim.behaviors.scroll = {
1010 set: function(anim, att, from, to, elapsed, duration, fn) {
1011 var
1012 node = anim._node,
1013 val = ([
1014 fn(elapsed, NUM(from[0]), NUM(to[0]) - NUM(from[0]), duration),
1015 fn(elapsed, NUM(from[1]), NUM(to[1]) - NUM(from[1]), duration)
1016 ]);
1017
1018 if (val[0]) {
1019 node.set('scrollLeft', val[0]);
1020 }
1021
1022 if (val[1]) {
1023 node.set('scrollTop', val[1]);
1024 }
1025 },
1026 get: function(anim) {
1027 var node = anim._node;
1028 return [node.get('scrollLeft'), node.get('scrollTop')];
1029 }
1030};
1031
1032/**
1033 * Adds support for the <code>curve</code> property for the <code>to</code>
1034 * attribute. A curve is zero or more control points and an end point.
1035 * @module anim
1036 * @submodule anim-curve
1037 * @for Anim
1038 */
1039
1040Y.Anim.behaviors.curve = {
1041 set: function(anim, att, from, to, elapsed, duration, fn) {
1042 from = from.slice.call(from);
1043 to = to.slice.call(to);
1044 var t = fn(elapsed, 0, 100, duration) / 100;
1045 to.unshift(from);
1046 anim._node.setXY(Y.Anim.getBezier(to, t));
1047 },
1048
1049 get: function(anim, att) {
1050 return anim._node.getXY();
1051 }
1052};
1053
1054/**
1055 * Get the current position of the animated element based on t.
1056 * Each point is an array of "x" and "y" values (0 = x, 1 = y)
1057 * At least 2 points are required (start and end).
1058 * First point is start. Last point is end.
1059 * Additional control points are optional.
1060 * @method getBezier
1061 * @static
1062 * @param {Array} points An array containing Bezier points
1063 * @param {Number} t A number between 0 and 1 which is the basis for determining current position
1064 * @return {Array} An array containing int x and y member data
1065 */
1066Y.Anim.getBezier = function(points, t) {
1067 var n = points.length;
1068 var tmp = [];
1069
1070 for (var i = 0; i < n; ++i){
1071 tmp[i] = [points[i][0], points[i][1]]; // save input
1072 }
1073
1074 for (var j = 1; j < n; ++j) {
1075 for (i = 0; i < n - j; ++i) {
1076 tmp[i][0] = (1 - t) * tmp[i][0] + t * tmp[parseInt(i + 1, 10)][0];
1077 tmp[i][1] = (1 - t) * tmp[i][1] + t * tmp[parseInt(i + 1, 10)][1];
1078 }
1079 }
1080
1081 return [ tmp[0][0], tmp[0][1] ];
1082
1083};
1084/**
1085 * Binds an Anim instance to a Node instance
1086 * @module anim
1087 * @namespace plugin
1088 * @submodule anim-node-plugin
1089 */
1090
1091var NodeFX = function(config) {
1092 var config = Y.merge(config);
1093 config.node = config.owner;
1094 NodeFX.superclass.constructor.apply(this, arguments);
1095};
1096
1097NodeFX.NAME = "nodefx";
1098NodeFX.NS = "fx";
1099
1100Y.extend(NodeFX, Y.Anim);
1101
1102Y.namespace('plugin');
1103Y.plugin.NodeFX = NodeFX;
1104
1105
1106}, '3.0.0pr2' ,{requires:['base', 'node']});
11070
=== removed file 'src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-easing-debug.js'
--- src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-easing-debug.js 2008-12-15 13:29:08 +0000
+++ src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-easing-debug.js 1970-01-01 00:00:00 +0000
@@ -1,353 +0,0 @@
1/*
2Copyright (c) 2008, Yahoo! Inc. All rights reserved.
3Code licensed under the BSD License:
4http://developer.yahoo.net/yui/license.txt
5version: 3.0.0pr2
6*/
7YUI.add('anim-easing', function(Y) {
8
9/*
10TERMS OF USE - EASING EQUATIONS
11Open source under the BSD License.
12Copyright 2001 Robert Penner All rights reserved.
13
14Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
15
16 * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
17 * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
18 * Neither the name of the author nor the names of contributors may be used to endorse or promote products derived from this software without specific prior written permission.
19
20THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
21*/
22
23/**
24 * The easing module provides methods for customizing
25 * how an animation behaves during each run.
26 * @class Easing
27 * @module anim
28 * @submodule anim-easing
29 */
30
31Y.Easing = {
32
33 /**
34 * Uniform speed between points.
35 * @method easeNone
36 * @param {Number} t Time value used to compute current value
37 * @param {Number} b Starting value
38 * @param {Number} c Delta between start and end values
39 * @param {Number} d Total length of animation
40 * @return {Number} The computed value for the current animation frame
41 */
42 easeNone: function (t, b, c, d) {
43 return c*t/d + b;
44 },
45
46 /**
47 * Begins slowly and accelerates towards end. (quadratic)
48 * @method easeIn
49 * @param {Number} t Time value used to compute current value
50 * @param {Number} b Starting value
51 * @param {Number} c Delta between start and end values
52 * @param {Number} d Total length of animation
53 * @return {Number} The computed value for the current animation frame
54 */
55 easeIn: function (t, b, c, d) {
56 return c*(t/=d)*t + b;
57 },
58
59 /**
60 * Begins quickly and decelerates towards end. (quadratic)
61 * @method easeOut
62 * @param {Number} t Time value used to compute current value
63 * @param {Number} b Starting value
64 * @param {Number} c Delta between start and end values
65 * @param {Number} d Total length of animation
66 * @return {Number} The computed value for the current animation frame
67 */
68 easeOut: function (t, b, c, d) {
69 return -c *(t/=d)*(t-2) + b;
70 },
71
72 /**
73 * Begins slowly and decelerates towards end. (quadratic)
74 * @method easeBoth
75 * @param {Number} t Time value used to compute current value
76 * @param {Number} b Starting value
77 * @param {Number} c Delta between start and end values
78 * @param {Number} d Total length of animation
79 * @return {Number} The computed value for the current animation frame
80 */
81 easeBoth: function (t, b, c, d) {
82 if ((t/=d/2) < 1) {
83 return c/2*t*t + b;
84 }
85
86 return -c/2 * ((--t)*(t-2) - 1) + b;
87 },
88
89 /**
90 * Begins slowly and accelerates towards end. (quartic)
91 * @method easeInStrong
92 * @param {Number} t Time value used to compute current value
93 * @param {Number} b Starting value
94 * @param {Number} c Delta between start and end values
95 * @param {Number} d Total length of animation
96 * @return {Number} The computed value for the current animation frame
97 */
98 easeInStrong: function (t, b, c, d) {
99 return c*(t/=d)*t*t*t + b;
100 },
101
102 /**
103 * Begins quickly and decelerates towards end. (quartic)
104 * @method easeOutStrong
105 * @param {Number} t Time value used to compute current value
106 * @param {Number} b Starting value
107 * @param {Number} c Delta between start and end values
108 * @param {Number} d Total length of animation
109 * @return {Number} The computed value for the current animation frame
110 */
111 easeOutStrong: function (t, b, c, d) {
112 return -c * ((t=t/d-1)*t*t*t - 1) + b;
113 },
114
115 /**
116 * Begins slowly and decelerates towards end. (quartic)
117 * @method easeBothStrong
118 * @param {Number} t Time value used to compute current value
119 * @param {Number} b Starting value
120 * @param {Number} c Delta between start and end values
121 * @param {Number} d Total length of animation
122 * @return {Number} The computed value for the current animation frame
123 */
124 easeBothStrong: function (t, b, c, d) {
125 if ((t/=d/2) < 1) {
126 return c/2*t*t*t*t + b;
127 }
128
129 return -c/2 * ((t-=2)*t*t*t - 2) + b;
130 },
131
132 /**
133 * Snap in elastic effect.
134 * @method elasticIn
135 * @param {Number} t Time value used to compute current value
136 * @param {Number} b Starting value
137 * @param {Number} c Delta between start and end values
138 * @param {Number} d Total length of animation
139 * @param {Number} a Amplitude (optional)
140 * @param {Number} p Period (optional)
141 * @return {Number} The computed value for the current animation frame
142 */
143
144 elasticIn: function (t, b, c, d, a, p) {
145 var s;
146 if (t === 0) {
147 return b;
148 }
149 if ( (t /= d) === 1 ) {
150 return b+c;
151 }
152 if (!p) {
153 p = d* 0.3;
154 }
155
156 if (!a || a < Math.abs(c)) {
157 a = c;
158 s = p/4;
159 }
160 else {
161 s = p/(2*Math.PI) * Math.asin (c/a);
162 }
163
164 return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
165 },
166
167 /**
168 * Snap out elastic effect.
169 * @method elasticOut
170 * @param {Number} t Time value used to compute current value
171 * @param {Number} b Starting value
172 * @param {Number} c Delta between start and end values
173 * @param {Number} d Total length of animation
174 * @param {Number} a Amplitude (optional)
175 * @param {Number} p Period (optional)
176 * @return {Number} The computed value for the current animation frame
177 */
178 elasticOut: function (t, b, c, d, a, p) {
179 var s;
180 if (t === 0) {
181 return b;
182 }
183 if ( (t /= d) === 1 ) {
184 return b+c;
185 }
186 if (!p) {
187 p=d * 0.3;
188 }
189
190 if (!a || a < Math.abs(c)) {
191 a = c;
192 s = p / 4;
193 }
194 else {
195 s = p/(2*Math.PI) * Math.asin (c/a);
196 }
197
198 return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;
199 },
200
201 /**
202 * Snap both elastic effect.
203 * @method elasticBoth
204 * @param {Number} t Time value used to compute current value
205 * @param {Number} b Starting value
206 * @param {Number} c Delta between start and end values
207 * @param {Number} d Total length of animation
208 * @param {Number} a Amplitude (optional)
209 * @param {Number} p Period (optional)
210 * @return {Number} The computed value for the current animation frame
211 */
212 elasticBoth: function (t, b, c, d, a, p) {
213 var s;
214 if (t === 0) {
215 return b;
216 }
217
218 if ( (t /= d/2) === 2 ) {
219 return b+c;
220 }
221
222 if (!p) {
223 p = d*(0.3*1.5);
224 }
225
226 if ( !a || a < Math.abs(c) ) {
227 a = c;
228 s = p/4;
229 }
230 else {
231 s = p/(2*Math.PI) * Math.asin (c/a);
232 }
233
234 if (t < 1) {
235 return -0.5*(a*Math.pow(2,10*(t-=1)) *
236 Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
237 }
238 return a*Math.pow(2,-10*(t-=1)) *
239 Math.sin( (t*d-s)*(2*Math.PI)/p )*0.5 + c + b;
240 },
241
242
243 /**
244 * Backtracks slightly, then reverses direction and moves to end.
245 * @method backIn
246 * @param {Number} t Time value used to compute current value
247 * @param {Number} b Starting value
248 * @param {Number} c Delta between start and end values
249 * @param {Number} d Total length of animation
250 * @param {Number} s Overshoot (optional)
251 * @return {Number} The computed value for the current animation frame
252 */
253 backIn: function (t, b, c, d, s) {
254 if (s == undefined) {
255 s = 1.70158;
256 }
257 if (t === d) {
258 t -= 0.001;
259 }
260 return c*(t/=d)*t*((s+1)*t - s) + b;
261 },
262
263 /**
264 * Overshoots end, then reverses and comes back to end.
265 * @method backOut
266 * @param {Number} t Time value used to compute current value
267 * @param {Number} b Starting value
268 * @param {Number} c Delta between start and end values
269 * @param {Number} d Total length of animation
270 * @param {Number} s Overshoot (optional)
271 * @return {Number} The computed value for the current animation frame
272 */
273 backOut: function (t, b, c, d, s) {
274 if (typeof s === 'undefined') {
275 s = 1.70158;
276 }
277 return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;
278 },
279
280 /**
281 * Backtracks slightly, then reverses direction, overshoots end,
282 * then reverses and comes back to end.
283 * @method backBoth
284 * @param {Number} t Time value used to compute current value
285 * @param {Number} b Starting value
286 * @param {Number} c Delta between start and end values
287 * @param {Number} d Total length of animation
288 * @param {Number} s Overshoot (optional)
289 * @return {Number} The computed value for the current animation frame
290 */
291 backBoth: function (t, b, c, d, s) {
292 if (typeof s === 'undefined') {
293 s = 1.70158;
294 }
295
296 if ((t /= d/2 ) < 1) {
297 return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
298 }
299 return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
300 },
301
302 /**
303 * Bounce off of start.
304 * @method bounceIn
305 * @param {Number} t Time value used to compute current value
306 * @param {Number} b Starting value
307 * @param {Number} c Delta between start and end values
308 * @param {Number} d Total length of animation
309 * @return {Number} The computed value for the current animation frame
310 */
311 bounceIn: function (t, b, c, d) {
312 return c - Y.Easing.bounceOut(d-t, 0, c, d) + b;
313 },
314
315 /**
316 * Bounces off end.
317 * @method bounceOut
318 * @param {Number} t Time value used to compute current value
319 * @param {Number} b Starting value
320 * @param {Number} c Delta between start and end values
321 * @param {Number} d Total length of animation
322 * @return {Number} The computed value for the current animation frame
323 */
324 bounceOut: function (t, b, c, d) {
325 if ((t/=d) < (1/2.75)) {
326 return c*(7.5625*t*t) + b;
327 } else if (t < (2/2.75)) {
328 return c*(7.5625*(t-=(1.5/2.75))*t + 0.75) + b;
329 } else if (t < (2.5/2.75)) {
330 return c*(7.5625*(t-=(2.25/2.75))*t + 0.9375) + b;
331 }
332 return c*(7.5625*(t-=(2.625/2.75))*t + 0.984375) + b;
333 },
334
335 /**
336 * Bounces off start and end.
337 * @method bounceBoth
338 * @param {Number} t Time value used to compute current value
339 * @param {Number} b Starting value
340 * @param {Number} c Delta between start and end values
341 * @param {Number} d Total length of animation
342 * @return {Number} The computed value for the current animation frame
343 */
344 bounceBoth: function (t, b, c, d) {
345 if (t < d/2) {
346 return Y.Easing.bounceIn(t * 2, 0, c, d) * 0.5 + b;
347 }
348 return Y.Easing.bounceOut(t * 2 - d, 0, c, d) * 0.5 + c * 0.5 + b;
349 }
350};
351
352
353}, '3.0.0pr2' ,{requires:['anim-base']});
3540
=== removed file 'src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-easing-min.js'
--- src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-easing-min.js 2008-12-15 13:29:08 +0000
+++ src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-easing-min.js 1970-01-01 00:00:00 +0000
@@ -1,7 +0,0 @@
1/*
2Copyright (c) 2008, Yahoo! Inc. All rights reserved.
3Code licensed under the BSD License:
4http://developer.yahoo.net/yui/license.txt
5version: 3.0.0pr2
6*/
7YUI.add("anim-easing",function(A){A.Easing={easeNone:function(C,B,E,D){return E*C/D+B;},easeIn:function(C,B,E,D){return E*(C/=D)*C+B;},easeOut:function(C,B,E,D){return -E*(C/=D)*(C-2)+B;},easeBoth:function(C,B,E,D){if((C/=D/2)<1){return E/2*C*C+B;}return -E/2*((--C)*(C-2)-1)+B;},easeInStrong:function(C,B,E,D){return E*(C/=D)*C*C*C+B;},easeOutStrong:function(C,B,E,D){return -E*((C=C/D-1)*C*C*C-1)+B;},easeBothStrong:function(C,B,E,D){if((C/=D/2)<1){return E/2*C*C*C*C+B;}return -E/2*((C-=2)*C*C*C-2)+B;},elasticIn:function(D,B,H,G,C,F){var E;if(D===0){return B;}if((D/=G)===1){return B+H;}if(!F){F=G*0.3;}if(!C||C<Math.abs(H)){C=H;E=F/4;}else{E=F/(2*Math.PI)*Math.asin(H/C);}return -(C*Math.pow(2,10*(D-=1))*Math.sin((D*G-E)*(2*Math.PI)/F))+B;},elasticOut:function(D,B,H,G,C,F){var E;if(D===0){return B;}if((D/=G)===1){return B+H;}if(!F){F=G*0.3;}if(!C||C<Math.abs(H)){C=H;E=F/4;}else{E=F/(2*Math.PI)*Math.asin(H/C);}return C*Math.pow(2,-10*D)*Math.sin((D*G-E)*(2*Math.PI)/F)+H+B;},elasticBoth:function(D,B,H,G,C,F){var E;if(D===0){return B;}if((D/=G/2)===2){return B+H;}if(!F){F=G*(0.3*1.5);}if(!C||C<Math.abs(H)){C=H;E=F/4;}else{E=F/(2*Math.PI)*Math.asin(H/C);}if(D<1){return -0.5*(C*Math.pow(2,10*(D-=1))*Math.sin((D*G-E)*(2*Math.PI)/F))+B;}return C*Math.pow(2,-10*(D-=1))*Math.sin((D*G-E)*(2*Math.PI)/F)*0.5+H+B;},backIn:function(C,B,F,E,D){if(D==undefined){D=1.70158;}if(C===E){C-=0.001;}return F*(C/=E)*C*((D+1)*C-D)+B;},backOut:function(C,B,F,E,D){if(typeof D==="undefined"){D=1.70158;}return F*((C=C/E-1)*C*((D+1)*C+D)+1)+B;},backBoth:function(C,B,F,E,D){if(typeof D==="undefined"){D=1.70158;}if((C/=E/2)<1){return F/2*(C*C*(((D*=(1.525))+1)*C-D))+B;}return F/2*((C-=2)*C*(((D*=(1.525))+1)*C+D)+2)+B;},bounceIn:function(C,B,E,D){return E-A.Easing.bounceOut(D-C,0,E,D)+B;},bounceOut:function(C,B,E,D){if((C/=D)<(1/2.75)){return E*(7.5625*C*C)+B;}else{if(C<(2/2.75)){return E*(7.5625*(C-=(1.5/2.75))*C+0.75)+B;}else{if(C<(2.5/2.75)){return E*(7.5625*(C-=(2.25/2.75))*C+0.9375)+B;}}}return E*(7.5625*(C-=(2.625/2.75))*C+0.984375)+B;},bounceBoth:function(C,B,E,D){if(C<D/2){return A.Easing.bounceIn(C*2,0,E,D)*0.5+B;}return A.Easing.bounceOut(C*2-D,0,E,D)*0.5+E*0.5+B;}};},"3.0.0pr2",{requires:["anim-base"]});
8\ No newline at end of file0\ No newline at end of file
91
=== removed file 'src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-easing.js'
--- src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-easing.js 2008-12-15 13:29:08 +0000
+++ src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-easing.js 1970-01-01 00:00:00 +0000
@@ -1,353 +0,0 @@
1/*
2Copyright (c) 2008, Yahoo! Inc. All rights reserved.
3Code licensed under the BSD License:
4http://developer.yahoo.net/yui/license.txt
5version: 3.0.0pr2
6*/
7YUI.add('anim-easing', function(Y) {
8
9/*
10TERMS OF USE - EASING EQUATIONS
11Open source under the BSD License.
12Copyright 2001 Robert Penner All rights reserved.
13
14Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
15
16 * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
17 * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
18 * Neither the name of the author nor the names of contributors may be used to endorse or promote products derived from this software without specific prior written permission.
19
20THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
21*/
22
23/**
24 * The easing module provides methods for customizing
25 * how an animation behaves during each run.
26 * @class Easing
27 * @module anim
28 * @submodule anim-easing
29 */
30
31Y.Easing = {
32
33 /**
34 * Uniform speed between points.
35 * @method easeNone
36 * @param {Number} t Time value used to compute current value
37 * @param {Number} b Starting value
38 * @param {Number} c Delta between start and end values
39 * @param {Number} d Total length of animation
40 * @return {Number} The computed value for the current animation frame
41 */
42 easeNone: function (t, b, c, d) {
43 return c*t/d + b;
44 },
45
46 /**
47 * Begins slowly and accelerates towards end. (quadratic)
48 * @method easeIn
49 * @param {Number} t Time value used to compute current value
50 * @param {Number} b Starting value
51 * @param {Number} c Delta between start and end values
52 * @param {Number} d Total length of animation
53 * @return {Number} The computed value for the current animation frame
54 */
55 easeIn: function (t, b, c, d) {
56 return c*(t/=d)*t + b;
57 },
58
59 /**
60 * Begins quickly and decelerates towards end. (quadratic)
61 * @method easeOut
62 * @param {Number} t Time value used to compute current value
63 * @param {Number} b Starting value
64 * @param {Number} c Delta between start and end values
65 * @param {Number} d Total length of animation
66 * @return {Number} The computed value for the current animation frame
67 */
68 easeOut: function (t, b, c, d) {
69 return -c *(t/=d)*(t-2) + b;
70 },
71
72 /**
73 * Begins slowly and decelerates towards end. (quadratic)
74 * @method easeBoth
75 * @param {Number} t Time value used to compute current value
76 * @param {Number} b Starting value
77 * @param {Number} c Delta between start and end values
78 * @param {Number} d Total length of animation
79 * @return {Number} The computed value for the current animation frame
80 */
81 easeBoth: function (t, b, c, d) {
82 if ((t/=d/2) < 1) {
83 return c/2*t*t + b;
84 }
85
86 return -c/2 * ((--t)*(t-2) - 1) + b;
87 },
88
89 /**
90 * Begins slowly and accelerates towards end. (quartic)
91 * @method easeInStrong
92 * @param {Number} t Time value used to compute current value
93 * @param {Number} b Starting value
94 * @param {Number} c Delta between start and end values
95 * @param {Number} d Total length of animation
96 * @return {Number} The computed value for the current animation frame
97 */
98 easeInStrong: function (t, b, c, d) {
99 return c*(t/=d)*t*t*t + b;
100 },
101
102 /**
103 * Begins quickly and decelerates towards end. (quartic)
104 * @method easeOutStrong
105 * @param {Number} t Time value used to compute current value
106 * @param {Number} b Starting value
107 * @param {Number} c Delta between start and end values
108 * @param {Number} d Total length of animation
109 * @return {Number} The computed value for the current animation frame
110 */
111 easeOutStrong: function (t, b, c, d) {
112 return -c * ((t=t/d-1)*t*t*t - 1) + b;
113 },
114
115 /**
116 * Begins slowly and decelerates towards end. (quartic)
117 * @method easeBothStrong
118 * @param {Number} t Time value used to compute current value
119 * @param {Number} b Starting value
120 * @param {Number} c Delta between start and end values
121 * @param {Number} d Total length of animation
122 * @return {Number} The computed value for the current animation frame
123 */
124 easeBothStrong: function (t, b, c, d) {
125 if ((t/=d/2) < 1) {
126 return c/2*t*t*t*t + b;
127 }
128
129 return -c/2 * ((t-=2)*t*t*t - 2) + b;
130 },
131
132 /**
133 * Snap in elastic effect.
134 * @method elasticIn
135 * @param {Number} t Time value used to compute current value
136 * @param {Number} b Starting value
137 * @param {Number} c Delta between start and end values
138 * @param {Number} d Total length of animation
139 * @param {Number} a Amplitude (optional)
140 * @param {Number} p Period (optional)
141 * @return {Number} The computed value for the current animation frame
142 */
143
144 elasticIn: function (t, b, c, d, a, p) {
145 var s;
146 if (t === 0) {
147 return b;
148 }
149 if ( (t /= d) === 1 ) {
150 return b+c;
151 }
152 if (!p) {
153 p = d* 0.3;
154 }
155
156 if (!a || a < Math.abs(c)) {
157 a = c;
158 s = p/4;
159 }
160 else {
161 s = p/(2*Math.PI) * Math.asin (c/a);
162 }
163
164 return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
165 },
166
167 /**
168 * Snap out elastic effect.
169 * @method elasticOut
170 * @param {Number} t Time value used to compute current value
171 * @param {Number} b Starting value
172 * @param {Number} c Delta between start and end values
173 * @param {Number} d Total length of animation
174 * @param {Number} a Amplitude (optional)
175 * @param {Number} p Period (optional)
176 * @return {Number} The computed value for the current animation frame
177 */
178 elasticOut: function (t, b, c, d, a, p) {
179 var s;
180 if (t === 0) {
181 return b;
182 }
183 if ( (t /= d) === 1 ) {
184 return b+c;
185 }
186 if (!p) {
187 p=d * 0.3;
188 }
189
190 if (!a || a < Math.abs(c)) {
191 a = c;
192 s = p / 4;
193 }
194 else {
195 s = p/(2*Math.PI) * Math.asin (c/a);
196 }
197
198 return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;
199 },
200
201 /**
202 * Snap both elastic effect.
203 * @method elasticBoth
204 * @param {Number} t Time value used to compute current value
205 * @param {Number} b Starting value
206 * @param {Number} c Delta between start and end values
207 * @param {Number} d Total length of animation
208 * @param {Number} a Amplitude (optional)
209 * @param {Number} p Period (optional)
210 * @return {Number} The computed value for the current animation frame
211 */
212 elasticBoth: function (t, b, c, d, a, p) {
213 var s;
214 if (t === 0) {
215 return b;
216 }
217
218 if ( (t /= d/2) === 2 ) {
219 return b+c;
220 }
221
222 if (!p) {
223 p = d*(0.3*1.5);
224 }
225
226 if ( !a || a < Math.abs(c) ) {
227 a = c;
228 s = p/4;
229 }
230 else {
231 s = p/(2*Math.PI) * Math.asin (c/a);
232 }
233
234 if (t < 1) {
235 return -0.5*(a*Math.pow(2,10*(t-=1)) *
236 Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
237 }
238 return a*Math.pow(2,-10*(t-=1)) *
239 Math.sin( (t*d-s)*(2*Math.PI)/p )*0.5 + c + b;
240 },
241
242
243 /**
244 * Backtracks slightly, then reverses direction and moves to end.
245 * @method backIn
246 * @param {Number} t Time value used to compute current value
247 * @param {Number} b Starting value
248 * @param {Number} c Delta between start and end values
249 * @param {Number} d Total length of animation
250 * @param {Number} s Overshoot (optional)
251 * @return {Number} The computed value for the current animation frame
252 */
253 backIn: function (t, b, c, d, s) {
254 if (s == undefined) {
255 s = 1.70158;
256 }
257 if (t === d) {
258 t -= 0.001;
259 }
260 return c*(t/=d)*t*((s+1)*t - s) + b;
261 },
262
263 /**
264 * Overshoots end, then reverses and comes back to end.
265 * @method backOut
266 * @param {Number} t Time value used to compute current value
267 * @param {Number} b Starting value
268 * @param {Number} c Delta between start and end values
269 * @param {Number} d Total length of animation
270 * @param {Number} s Overshoot (optional)
271 * @return {Number} The computed value for the current animation frame
272 */
273 backOut: function (t, b, c, d, s) {
274 if (typeof s === 'undefined') {
275 s = 1.70158;
276 }
277 return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;
278 },
279
280 /**
281 * Backtracks slightly, then reverses direction, overshoots end,
282 * then reverses and comes back to end.
283 * @method backBoth
284 * @param {Number} t Time value used to compute current value
285 * @param {Number} b Starting value
286 * @param {Number} c Delta between start and end values
287 * @param {Number} d Total length of animation
288 * @param {Number} s Overshoot (optional)
289 * @return {Number} The computed value for the current animation frame
290 */
291 backBoth: function (t, b, c, d, s) {
292 if (typeof s === 'undefined') {
293 s = 1.70158;
294 }
295
296 if ((t /= d/2 ) < 1) {
297 return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
298 }
299 return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
300 },
301
302 /**
303 * Bounce off of start.
304 * @method bounceIn
305 * @param {Number} t Time value used to compute current value
306 * @param {Number} b Starting value
307 * @param {Number} c Delta between start and end values
308 * @param {Number} d Total length of animation
309 * @return {Number} The computed value for the current animation frame
310 */
311 bounceIn: function (t, b, c, d) {
312 return c - Y.Easing.bounceOut(d-t, 0, c, d) + b;
313 },
314
315 /**
316 * Bounces off end.
317 * @method bounceOut
318 * @param {Number} t Time value used to compute current value
319 * @param {Number} b Starting value
320 * @param {Number} c Delta between start and end values
321 * @param {Number} d Total length of animation
322 * @return {Number} The computed value for the current animation frame
323 */
324 bounceOut: function (t, b, c, d) {
325 if ((t/=d) < (1/2.75)) {
326 return c*(7.5625*t*t) + b;
327 } else if (t < (2/2.75)) {
328 return c*(7.5625*(t-=(1.5/2.75))*t + 0.75) + b;
329 } else if (t < (2.5/2.75)) {
330 return c*(7.5625*(t-=(2.25/2.75))*t + 0.9375) + b;
331 }
332 return c*(7.5625*(t-=(2.625/2.75))*t + 0.984375) + b;
333 },
334
335 /**
336 * Bounces off start and end.
337 * @method bounceBoth
338 * @param {Number} t Time value used to compute current value
339 * @param {Number} b Starting value
340 * @param {Number} c Delta between start and end values
341 * @param {Number} d Total length of animation
342 * @return {Number} The computed value for the current animation frame
343 */
344 bounceBoth: function (t, b, c, d) {
345 if (t < d/2) {
346 return Y.Easing.bounceIn(t * 2, 0, c, d) * 0.5 + b;
347 }
348 return Y.Easing.bounceOut(t * 2 - d, 0, c, d) * 0.5 + c * 0.5 + b;
349 }
350};
351
352
353}, '3.0.0pr2' ,{requires:['anim-base']});
3540
=== removed file 'src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-min.js'
--- src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-min.js 2008-12-15 13:29:08 +0000
+++ src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-min.js 1970-01-01 00:00:00 +0000
@@ -1,8 +0,0 @@
1/*
2Copyright (c) 2008, Yahoo! Inc. All rights reserved.
3Code licensed under the BSD License:
4http://developer.yahoo.net/yui/license.txt
5version: 3.0.0pr2
6*/
7YUI.add("anim",function(C){var D="running",O="startTime",M="elapsedTime",K="start",J="tween",N="end",E="node",L="paused",Q="reverse",I="iterationCount",B=Number;var G={},P={},F;C.Anim=function(){C.Anim.superclass.constructor.apply(this,arguments);P[C.stamp(this)]=this;};C.Anim.NAME="anim";C.Anim.RE_DEFAULT_UNIT=/^width|height|top|right|bottom|left|margin.*|padding.*|border.*$/i;C.Anim.DEFAULT_UNIT="px";C.Anim.DEFAULT_EASING=function(S,R,U,T){return U*S/T+R;};C.Anim.behaviors={left:{get:function(S,R){return S._getOffset(R);}}};C.Anim.behaviors.top=C.Anim.behaviors.left;C.Anim.DEFAULT_SETTER=function(V,S,Y,X,R,W,T,U){U=U||"";V._node.setStyle(S,T(R,B(Y),B(X)-B(Y),W)+U);};C.Anim.DEFAULT_GETTER=function(R,S){return R._node.getComputedStyle(S);};C.Anim.ATTRS={node:{set:function(R){R=C.Node.get(R);this._node=R;if(!R){C.fail("Y.Anim: invalid node: "+R);}return R;}},duration:{value:1},easing:{value:C.Anim.DEFAULT_EASING,set:function(R){if(typeof R==="string"&&C.Easing){return C.Easing[R];}}},from:{},to:{},startTime:{value:0,readOnly:true},elapsedTime:{value:0,readOnly:true},running:{get:function(){return !!G[C.stamp(this)];},value:false,readOnly:true},iterations:{value:1},iterationCount:{value:0,readOnly:true},direction:{value:"normal"},paused:{readOnly:true,value:false},reverse:{value:false}};C.Anim.run=function(){for(var R in P){if(P[R].run){P[R].run();}}};C.Anim.pause=function(){for(var R in G){if(G[R].pause){G[R].pause();}}C.Anim._stopTimer();};C.Anim.stop=function(){for(var R in G){if(G[R].stop){G[R].stop();}}C.Anim._stopTimer();};C.Anim._startTimer=function(){if(!F){F=setInterval(C.Anim._runFrame,1);}};C.Anim._stopTimer=function(){clearInterval(F);F=0;};C.Anim._runFrame=function(){var R=true;for(var S in G){if(G[S]._runFrame){R=false;G[S]._runFrame();}}if(R){C.Anim._stopTimer();}};C.Anim.RE_UNITS=/^(-?\d*\.?\d*){1}(em|ex|px|in|cm|mm|pt|pc|%)*$/;var H={run:function(){if(!this.get(D)){this._start();}else{if(this.get(L)){this._resume();}}return this;},pause:function(){if(this.get(D)){this._pause();}return this;},stop:function(R){if(this.get(D)||this.get(L)){this._end(R);}return this;},_added:false,_start:function(){this._set(O,new Date()-this.get(M));this._actualFrames=0;if(!this.get(L)){this._initAttr();}G[C.stamp(this)]=this;C.Anim._startTimer();this.fire(K);},_pause:function(){this._set(O,null);this._set(L,true);delete G[C.stamp(this)];this.fire("pause");},_resume:function(){this._set(L,false);G[C.stamp(this)]=this;this.fire("resume");},_end:function(R){this._set(O,null);this._set(M,0);this._set(L,false);delete G[C.stamp(this)];this.fire(N,{elapsed:this.get(M)});},_runFrame:function(){var Y=this._runtimeAttr,T=C.Anim.behaviors,Z=Y.easing,a=Y.duration,b=new Date()-this.get(O),X=this.get(Q),V=(b>=a),R=a,S,U;if(X){b=a-b;V=(b<=0);R=0;}for(var W in Y){if(Y[W].to){S=Y[W];U=(W in T&&"set" in T[W])?T[W].set:C.Anim.DEFAULT_SETTER;if(!V){U(this,W,S.from,S.to,b,a,Z,S.unit);}else{U(this,W,S.from,S.to,R,a,Z,S.unit);}}}this._actualFrames+=1;this._set(M,b);this.fire(J);if(V){this._lastFrame();}},_lastFrame:function(){var R=this.get("iterations"),S=this.get(I);S+=1;if(R==="infinite"||S<R){if(this.get("direction")==="alternate"){this.set(Q,!this.get(Q));}this.fire("iteration");}else{S=0;this._end();}this._set(O,new Date());this._set(I,S);},_initAttr:function(){var Y=this.get("from")||{},Z=this.get("to")||{},R=this.get("duration")*1000,U=this.get(E),X=this.get("easing")||{},W={},S=C.Anim.behaviors,a,T,V;C.each(Z,function(g,d){if(typeof g==="function"){g=g.call(this,U);}T=Y[d];if(T===undefined){T=(d in S&&"get" in S[d])?S[d].get(this,d):C.Anim.DEFAULT_GETTER(this,d);}else{if(typeof T==="function"){T=T.call(this,U);}}var c=C.Anim.RE_UNITS.exec(T);var e=C.Anim.RE_UNITS.exec(g);T=c?c[1]:T;var b=e?e[1]:g,f=e?e[2]:c?c[2]:"";if(!f&&C.Anim.RE_DEFAULT_UNIT.test(d)){f=C.Anim.DEFAULT_UNIT;}if(!T||!b){C.fail('invalid "from" or "to" for "'+d+'"',"Anim");return ;}W[d]={from:T,to:b,unit:f};W.duration=R;W.easing=X;},this);this._runtimeAttr=W;},_getOffset:function(S){var U=this._node,V=U.getComputedStyle(S),T=(S==="left")?"getX":"getY",W=(S==="left")?"setX":"setY";if(V==="auto"){var R=U.getStyle("position");if(R==="absolute"||R==="fixed"){V=U[T]();U[W](V);}else{V=0;}}return V;}};C.extend(C.Anim,C.Base,H);C.Easing={easeNone:function(S,R,U,T){return U*S/T+R;},easeIn:function(S,R,U,T){return U*(S/=T)*S+R;},easeOut:function(S,R,U,T){return -U*(S/=T)*(S-2)+R;},easeBoth:function(S,R,U,T){if((S/=T/2)<1){return U/2*S*S+R;}return -U/2*((--S)*(S-2)-1)+R;},easeInStrong:function(S,R,U,T){return U*(S/=T)*S*S*S+R;},easeOutStrong:function(S,R,U,T){return -U*((S=S/T-1)*S*S*S-1)+R;},easeBothStrong:function(S,R,U,T){if((S/=T/2)<1){return U/2*S*S*S*S+R;}return -U/2*((S-=2)*S*S*S-2)+R;},elasticIn:function(T,R,X,W,S,V){var U;if(T===0){return R;}if((T/=W)===1){return R+X;}if(!V){V=W*0.3;}if(!S||S<Math.abs(X)){S=X;U=V/4;}else{U=V/(2*Math.PI)*Math.asin(X/S);}return -(S*Math.pow(2,10*(T-=1))*Math.sin((T*W-U)*(2*Math.PI)/V))+R;},elasticOut:function(T,R,X,W,S,V){var U;if(T===0){return R;}if((T/=W)===1){return R+X;}if(!V){V=W*0.3;}if(!S||S<Math.abs(X)){S=X;U=V/4;}else{U=V/(2*Math.PI)*Math.asin(X/S);}return S*Math.pow(2,-10*T)*Math.sin((T*W-U)*(2*Math.PI)/V)+X+R;},elasticBoth:function(T,R,X,W,S,V){var U;if(T===0){return R;}if((T/=W/2)===2){return R+X;}if(!V){V=W*(0.3*1.5);}if(!S||S<Math.abs(X)){S=X;U=V/4;}else{U=V/(2*Math.PI)*Math.asin(X/S);}if(T<1){return -0.5*(S*Math.pow(2,10*(T-=1))*Math.sin((T*W-U)*(2*Math.PI)/V))+R;}return S*Math.pow(2,-10*(T-=1))*Math.sin((T*W-U)*(2*Math.PI)/V)*0.5+X+R;},backIn:function(S,R,V,U,T){if(T==undefined){T=1.70158;}if(S===U){S-=0.001;}return V*(S/=U)*S*((T+1)*S-T)+R;},backOut:function(S,R,V,U,T){if(typeof T==="undefined"){T=1.70158;}return V*((S=S/U-1)*S*((T+1)*S+T)+1)+R;},backBoth:function(S,R,V,U,T){if(typeof T==="undefined"){T=1.70158;}if((S/=U/2)<1){return V/2*(S*S*(((T*=(1.525))+1)*S-T))+R;}return V/2*((S-=2)*S*(((T*=(1.525))+1)*S+T)+2)+R;},bounceIn:function(S,R,U,T){return U-C.Easing.bounceOut(T-S,0,U,T)+R;},bounceOut:function(S,R,U,T){if((S/=T)<(1/2.75)){return U*(7.5625*S*S)+R;
8}else{if(S<(2/2.75)){return U*(7.5625*(S-=(1.5/2.75))*S+0.75)+R;}else{if(S<(2.5/2.75)){return U*(7.5625*(S-=(2.25/2.75))*S+0.9375)+R;}}}return U*(7.5625*(S-=(2.625/2.75))*S+0.984375)+R;},bounceBoth:function(S,R,U,T){if(S<T/2){return C.Easing.bounceIn(S*2,0,U,T)*0.5+R;}return C.Easing.bounceOut(S*2-T,0,U,T)*0.5+U*0.5+R;}};var B=Number;C.Anim.behaviors.xy={set:function(U,S,X,W,R,V,T){U._node.setXY([T(R,B(X[0]),B(W[0])-B(X[0]),V),T(R,B(X[1]),B(W[1])-B(X[1]),V)]);},get:function(R){return R._node.getXY();}};var B=Number;C.Anim.behaviors.color={set:function(U,S,X,W,R,V,T){X=C.Color.re_RGB.exec(C.Color.toRGB(X));W=C.Color.re_RGB.exec(C.Color.toRGB(W));if(!X||X.length<3||!W||W.length<3){C.fail("invalid from or to passed to color behavior");}U._node.setStyle(S,"rgb("+[Math.floor(T(R,B(X[1]),B(W[1])-B(X[1]),V)),Math.floor(T(R,B(X[2]),B(W[2])-B(X[2]),V)),Math.floor(T(R,B(X[3]),B(W[3])-B(X[3]),V))].join(", ")+")");},get:function(S,R){var T=S._node.getComputedStyle(R);T=(T==="transparent")?"rgb(255, 255, 255)":T;return T;}};C.each(["backgroundColor","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"],function(R,S){C.Anim.behaviors[R]=C.Anim.behaviors.color;});var B=Number;C.Anim.behaviors.scroll={set:function(U,V,X,Y,Z,T,W){var S=U._node,R=([W(Z,B(X[0]),B(Y[0])-B(X[0]),T),W(Z,B(X[1]),B(Y[1])-B(X[1]),T)]);if(R[0]){S.set("scrollLeft",R[0]);}if(R[1]){S.set("scrollTop",R[1]);}},get:function(S){var R=S._node;return[R.get("scrollLeft"),R.get("scrollTop")];}};C.Anim.behaviors.curve={set:function(V,S,Y,X,R,W,U){Y=Y.slice.call(Y);X=X.slice.call(X);var T=U(R,0,100,W)/100;X.unshift(Y);V._node.setXY(C.Anim.getBezier(X,T));},get:function(S,R){return S._node.getXY();}};C.Anim.getBezier=function(V,U){var W=V.length;var T=[];for(var S=0;S<W;++S){T[S]=[V[S][0],V[S][1]];}for(var R=1;R<W;++R){for(S=0;S<W-R;++S){T[S][0]=(1-U)*T[S][0]+U*T[parseInt(S+1,10)][0];T[S][1]=(1-U)*T[S][1]+U*T[parseInt(S+1,10)][1];}}return[T[0][0],T[0][1]];};var A=function(R){var R=C.merge(R);R.node=R.owner;A.superclass.constructor.apply(this,arguments);};A.NAME="nodefx";A.NS="fx";C.extend(A,C.Anim);C.namespace("plugin");C.plugin.NodeFX=A;},"3.0.0pr2",{requires:["base","node"]});
9\ No newline at end of file0\ No newline at end of file
101
=== removed file 'src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-node-plugin-debug.js'
--- src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-node-plugin-debug.js 2008-12-15 13:29:08 +0000
+++ src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-node-plugin-debug.js 1970-01-01 00:00:00 +0000
@@ -1,28 +0,0 @@
1/*
2Copyright (c) 2008, Yahoo! Inc. All rights reserved.
3Code licensed under the BSD License:
4http://developer.yahoo.net/yui/license.txt
5version: 3.0.0pr2
6*/
7YUI.add('anim-node-plugin', function(Y) {
8
9/**
10 * Binds an Anim instance to a Node instance
11 * @module anim
12 * @submodule anim-node-plugin
13 */
14
15Y.namespace('Plugin');
16Y.Plugin.NodeFX = function(config) {
17 config.node = config.owner;
18 Y.Plugin.NodeFX.superclass.constructor.apply(this, arguments);
19};
20
21Y.Plugin.NodeFX.NAME = "nodefxplugin";
22Y.Plugin.NodeFX.NS = "fx";
23
24Y.extend(Y.Plugin.NodeFX, Y.Anim);
25
26
27
28}, '3.0.0pr2' ,{requires:['anim-base', 'node-base']});
290
=== removed file 'src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-node-plugin-min.js'
--- src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-node-plugin-min.js 2008-12-15 13:29:08 +0000
+++ src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-node-plugin-min.js 1970-01-01 00:00:00 +0000
@@ -1,7 +0,0 @@
1/*
2Copyright (c) 2008, Yahoo! Inc. All rights reserved.
3Code licensed under the BSD License:
4http://developer.yahoo.net/yui/license.txt
5version: 3.0.0pr2
6*/
7YUI.add("anim-node-plugin",function(A){A.namespace("Plugin");A.Plugin.NodeFX=function(B){B.node=B.owner;A.Plugin.NodeFX.superclass.constructor.apply(this,arguments);};A.Plugin.NodeFX.NAME="nodefxplugin";A.Plugin.NodeFX.NS="fx";A.extend(A.Plugin.NodeFX,A.Anim);},"3.0.0pr2",{requires:["anim-base","node-base"]});
8\ No newline at end of file0\ No newline at end of file
91
=== removed file 'src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-node-plugin.js'
--- src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-node-plugin.js 2008-12-15 13:29:08 +0000
+++ src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-node-plugin.js 1970-01-01 00:00:00 +0000
@@ -1,28 +0,0 @@
1/*
2Copyright (c) 2008, Yahoo! Inc. All rights reserved.
3Code licensed under the BSD License:
4http://developer.yahoo.net/yui/license.txt
5version: 3.0.0pr2
6*/
7YUI.add('anim-node-plugin', function(Y) {
8
9/**
10 * Binds an Anim instance to a Node instance
11 * @module anim
12 * @submodule anim-node-plugin
13 */
14
15Y.namespace('Plugin');
16Y.Plugin.NodeFX = function(config) {
17 config.node = config.owner;
18 Y.Plugin.NodeFX.superclass.constructor.apply(this, arguments);
19};
20
21Y.Plugin.NodeFX.NAME = "nodefxplugin";
22Y.Plugin.NodeFX.NS = "fx";
23
24Y.extend(Y.Plugin.NodeFX, Y.Anim);
25
26
27
28}, '3.0.0pr2' ,{requires:['anim-base', 'node-base']});
290
=== removed file 'src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-scroll-debug.js'
--- src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-scroll-debug.js 2008-12-15 13:29:08 +0000
+++ src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-scroll-debug.js 1970-01-01 00:00:00 +0000
@@ -1,44 +0,0 @@
1/*
2Copyright (c) 2008, Yahoo! Inc. All rights reserved.
3Code licensed under the BSD License:
4http://developer.yahoo.net/yui/license.txt
5version: 3.0.0pr2
6*/
7YUI.add('anim-scroll', function(Y) {
8
9/**
10 * Adds support for the <code>scroll</code> property in <code>to</code>
11 * and <code>from</code> attributes.
12 * @module anim
13 * @submodule anim-scroll
14 * @for Anim
15 */
16
17var NUM = Number;
18
19Y.Anim.behaviors.scroll = {
20 set: function(anim, att, from, to, elapsed, duration, fn) {
21 var
22 node = anim._node,
23 val = ([
24 fn(elapsed, NUM(from[0]), NUM(to[0]) - NUM(from[0]), duration),
25 fn(elapsed, NUM(from[1]), NUM(to[1]) - NUM(from[1]), duration)
26 ]);
27
28 if (val[0]) {
29 node.set('scrollLeft', val[0]);
30 }
31
32 if (val[1]) {
33 node.set('scrollTop', val[1]);
34 }
35 },
36 get: function(anim) {
37 var node = anim._node;
38 return [node.get('scrollLeft'), node.get('scrollTop')];
39 }
40};
41
42
43
44}, '3.0.0pr2' ,{requires:['anim-base', 'node-base']});
450
=== removed file 'src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-scroll-min.js'
--- src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-scroll-min.js 2008-12-15 13:29:08 +0000
+++ src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-scroll-min.js 1970-01-01 00:00:00 +0000
@@ -1,7 +0,0 @@
1/*
2Copyright (c) 2008, Yahoo! Inc. All rights reserved.
3Code licensed under the BSD License:
4http://developer.yahoo.net/yui/license.txt
5version: 3.0.0pr2
6*/
7YUI.add("anim-scroll",function(B){var A=Number;B.Anim.behaviors.scroll={set:function(F,G,I,J,K,E,H){var D=F._node,C=([H(K,A(I[0]),A(J[0])-A(I[0]),E),H(K,A(I[1]),A(J[1])-A(I[1]),E)]);if(C[0]){D.set("scrollLeft",C[0]);}if(C[1]){D.set("scrollTop",C[1]);}},get:function(D){var C=D._node;return[C.get("scrollLeft"),C.get("scrollTop")];}};},"3.0.0pr2",{requires:["anim-base","node-base"]});
8\ No newline at end of file0\ No newline at end of file
91
=== removed file 'src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-scroll.js'
--- src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-scroll.js 2008-12-15 13:29:08 +0000
+++ src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-scroll.js 1970-01-01 00:00:00 +0000
@@ -1,44 +0,0 @@
1/*
2Copyright (c) 2008, Yahoo! Inc. All rights reserved.
3Code licensed under the BSD License:
4http://developer.yahoo.net/yui/license.txt
5version: 3.0.0pr2
6*/
7YUI.add('anim-scroll', function(Y) {
8
9/**
10 * Adds support for the <code>scroll</code> property in <code>to</code>
11 * and <code>from</code> attributes.
12 * @module anim
13 * @submodule anim-scroll
14 * @for Anim
15 */
16
17var NUM = Number;
18
19Y.Anim.behaviors.scroll = {
20 set: function(anim, att, from, to, elapsed, duration, fn) {
21 var
22 node = anim._node,
23 val = ([
24 fn(elapsed, NUM(from[0]), NUM(to[0]) - NUM(from[0]), duration),
25 fn(elapsed, NUM(from[1]), NUM(to[1]) - NUM(from[1]), duration)
26 ]);
27
28 if (val[0]) {
29 node.set('scrollLeft', val[0]);
30 }
31
32 if (val[1]) {
33 node.set('scrollTop', val[1]);
34 }
35 },
36 get: function(anim) {
37 var node = anim._node;
38 return [node.get('scrollLeft'), node.get('scrollTop')];
39 }
40};
41
42
43
44}, '3.0.0pr2' ,{requires:['anim-base', 'node-base']});
450
=== removed file 'src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-xy-debug.js'
--- src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-xy-debug.js 2008-12-15 13:29:08 +0000
+++ src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-xy-debug.js 1970-01-01 00:00:00 +0000
@@ -1,33 +0,0 @@
1/*
2Copyright (c) 2008, Yahoo! Inc. All rights reserved.
3Code licensed under the BSD License:
4http://developer.yahoo.net/yui/license.txt
5version: 3.0.0pr2
6*/
7YUI.add('anim-xy', function(Y) {
8
9/**
10 * Adds support for the <code>xy</code> property in <code>from</code> and
11 * <code>to</code> attributes.
12 * @module anim
13 * @submodule anim-xy
14 * @for Anim
15 */
16
17var NUM = Number;
18
19Y.Anim.behaviors.xy = {
20 set: function(anim, att, from, to, elapsed, duration, fn) {
21 anim._node.setXY([
22 fn(elapsed, NUM(from[0]), NUM(to[0]) - NUM(from[0]), duration),
23 fn(elapsed, NUM(from[1]), NUM(to[1]) - NUM(from[1]), duration)
24 ]);
25 },
26 get: function(anim) {
27 return anim._node.getXY();
28 }
29};
30
31
32
33}, '3.0.0pr2' ,{requires:['anim-base', 'node-screen']});
340
=== removed file 'src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-xy-min.js'
--- src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-xy-min.js 2008-12-15 13:29:08 +0000
+++ src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-xy-min.js 1970-01-01 00:00:00 +0000
@@ -1,7 +0,0 @@
1/*
2Copyright (c) 2008, Yahoo! Inc. All rights reserved.
3Code licensed under the BSD License:
4http://developer.yahoo.net/yui/license.txt
5version: 3.0.0pr2
6*/
7YUI.add("anim-xy",function(B){var A=Number;B.Anim.behaviors.xy={set:function(F,D,I,H,C,G,E){F._node.setXY([E(C,A(I[0]),A(H[0])-A(I[0]),G),E(C,A(I[1]),A(H[1])-A(I[1]),G)]);},get:function(C){return C._node.getXY();}};},"3.0.0pr2",{requires:["anim-base","node-screen"]});
8\ No newline at end of file0\ No newline at end of file
91
=== removed file 'src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-xy.js'
--- src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-xy.js 2008-12-15 13:29:08 +0000
+++ src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-xy.js 1970-01-01 00:00:00 +0000
@@ -1,33 +0,0 @@
1/*
2Copyright (c) 2008, Yahoo! Inc. All rights reserved.
3Code licensed under the BSD License:
4http://developer.yahoo.net/yui/license.txt
5version: 3.0.0pr2
6*/
7YUI.add('anim-xy', function(Y) {
8
9/**
10 * Adds support for the <code>xy</code> property in <code>from</code> and
11 * <code>to</code> attributes.
12 * @module anim
13 * @submodule anim-xy
14 * @for Anim
15 */
16
17var NUM = Number;
18
19Y.Anim.behaviors.xy = {
20 set: function(anim, att, from, to, elapsed, duration, fn) {
21 anim._node.setXY([
22 fn(elapsed, NUM(from[0]), NUM(to[0]) - NUM(from[0]), duration),
23 fn(elapsed, NUM(from[1]), NUM(to[1]) - NUM(from[1]), duration)
24 ]);
25 },
26 get: function(anim) {
27 return anim._node.getXY();
28 }
29};
30
31
32
33}, '3.0.0pr2' ,{requires:['anim-base', 'node-screen']});
340
=== removed file 'src-js/lazrjs/yui/3.0.0pr2/build/anim/anim.js'
--- src-js/lazrjs/yui/3.0.0pr2/build/anim/anim.js 2008-12-15 13:29:08 +0000
+++ src-js/lazrjs/yui/3.0.0pr2/build/anim/anim.js 1970-01-01 00:00:00 +0000
@@ -1,1106 +0,0 @@
1/*
2Copyright (c) 2008, Yahoo! Inc. All rights reserved.
3Code licensed under the BSD License:
4http://developer.yahoo.net/yui/license.txt
5version: 3.0.0pr2
6*/
7YUI.add('anim', function(Y) {
8
9/**
10 * Y.Animation Utility.
11 * @module anim
12 */
13
14 /**
15 * Handles animation _queueing and threading.
16 * @class Anim
17 * @constructor
18 * @extends Base
19 */
20
21 var RUNNING = 'running',
22 START_TIME = 'startTime',
23 ELAPSED_TIME = 'elapsedTime',
24 /**
25 * @event start
26 * @description fires when an animation begins.
27 * @param {Event} ev The start event.
28 * @type Event.Custom
29 */
30 START = 'start',
31
32 /**
33 * @event tween
34 * @description fires every frame of the animation.
35 * @param {Event} ev The tween event.
36 * @type Event.Custom
37 */
38 TWEEN = 'tween',
39
40 /**
41 * @event end
42 * @description fires after the animation completes.
43 * @param {Event} ev The end event.
44 * @type Event.Custom
45 */
46 END = 'end',
47 NODE = 'node',
48 PAUSED = 'paused',
49 REVERSE = 'reverse', // TODO: cleanup
50 ITERATION_COUNT = 'iterationCount',
51
52 NUM = Number;
53
54 var _running = {},
55 _instances = {},
56 _timer;
57
58 Y.Anim = function() {
59 Y.Anim.superclass.constructor.apply(this, arguments);
60 _instances[Y.stamp(this)] = this;
61 };
62
63 Y.Anim.NAME = 'anim';
64
65 /**
66 * Regex of properties that should use the default unit.
67 *
68 * @property RE_DEFAULT_UNIT
69 * @static
70 */
71 Y.Anim.RE_DEFAULT_UNIT = /^width|height|top|right|bottom|left|margin.*|padding.*|border.*$/i;
72
73 /**
74 * The default unit to use with properties that pass the RE_DEFAULT_UNIT test.
75 *
76 * @property DEFAULT_UNIT
77 * @static
78 */
79 Y.Anim.DEFAULT_UNIT = 'px';
80
81 Y.Anim.DEFAULT_EASING = function (t, b, c, d) {
82 return c * t / d + b; // linear easing
83 };
84
85 /**
86 * Bucket for custom getters and setters
87 *
88 * @property behaviors
89 * @static
90 */
91 Y.Anim.behaviors = {
92 left: {
93 get: function(anim, attr) {
94 return anim._getOffset(attr);
95 }
96 }
97 };
98
99 Y.Anim.behaviors.top = Y.Anim.behaviors.left;
100
101 /**
102 * The default setter to use when setting object properties.
103 *
104 * @property DEFAULT_SETTER
105 * @static
106 */
107 Y.Anim.DEFAULT_SETTER = function(anim, att, from, to, elapsed, duration, fn, unit) {
108 unit = unit || '';
109 anim._node.setStyle(att, fn(elapsed, NUM(from), NUM(to) - NUM(from), duration) + unit);
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches

to all changes: