Merge lp:~urbanape/lazr-js/anim-multi-node into lp:~mars/lazr-js/lazr-sprint-1109
- anim-multi-node
- Merge into lazr-sprint-1109
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 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Paul Hummer (community) | Approve | ||
Review via email: mp+14703@code.launchpad.net |
Commit message
Description of the change
Zachery Bir (urbanape) wrote : | # |
- 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
Paul Hummer (rockstar) : | # |
- 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
1 | === modified file '.bzrignore' |
2 | --- .bzrignore 2009-11-03 21:59:24 +0000 |
3 | +++ .bzrignore 2009-11-13 15:43:10 +0000 |
4 | @@ -9,4 +9,7 @@ |
5 | ./download-cache |
6 | ./eggs |
7 | ./MANIFEST |
8 | +src-py/lazr_js.egg-info |
9 | +src-py/lazrjs |
10 | *.egg-info |
11 | +tags |
12 | |
13 | === modified file 'Makefile' |
14 | --- Makefile 2009-11-03 21:59:24 +0000 |
15 | +++ Makefile 2009-11-13 15:43:10 +0000 |
16 | @@ -6,6 +6,19 @@ |
17 | WD:=$(shell pwd) |
18 | PY=$(WD)/bin/py |
19 | |
20 | +# LAZR_SOURCEDEPS_DIR can be set to point to a directory that |
21 | +# contains a download-cache and eggs directory. If this environment |
22 | +# variable exist, the download-cache and eggs directories will be |
23 | +# symlinked, to make initial building faster. |
24 | +ifdef LAZR_SOURCEDEPS_DIR |
25 | + CREATE_EGGS_COMMAND=ln -s $(LAZR_SOURCEDEPS_DIR)/eggs |
26 | + CREATE_DOWNLOAD_CACHE_COMMAND=ln -s $(LAZR_SOURCEDEPS_DIR)/download-cache |
27 | +else |
28 | + CREATE_EGGS_COMMAND=mkdir eggs |
29 | + CREATE_DOWNLOAD_CACHE_COMMAND=bzr checkout \ |
30 | + lp:lazr-source-dependencies download-cache |
31 | +endif |
32 | + |
33 | # Update the build directory |
34 | build: $(PY) |
35 | $(PYTHON) -S bin/build |
36 | @@ -14,15 +27,19 @@ |
37 | $(PYTHON) -S bin/jslint |
38 | |
39 | eggs: |
40 | - mkdir eggs |
41 | + $(CREATE_EGGS_COMMAND) |
42 | |
43 | download-cache: |
44 | - bzr checkout lp:lazr-source-dependencies download-cache |
45 | + $(CREATE_DOWNLOAD_CACHE_COMMAND) |
46 | |
47 | # The download-cache dependency comes *before* eggs so that developers get the |
48 | # warning before the eggs directory is made. The target for the eggs directory |
49 | # is only there for deployment convenience. |
50 | bin/buildout: download-cache eggs |
51 | + if test ! -h src-py/lazrjs ; then \ |
52 | + ln -s ../src-js/lazrjs src-py/lazrjs;\ |
53 | + fi |
54 | + |
55 | $(SHHH) $(PYTHON) -S bootstrap.py\ |
56 | --ez_setup-source=ez_setup.py \ |
57 | --download-base=download-cache/dist --eggs=eggs |
58 | @@ -34,4 +51,8 @@ |
59 | clean: |
60 | rm -fr build/* bin |
61 | |
62 | +dist-clean: |
63 | + rm -fr download-cache eggs |
64 | + rm src-py/lazrjs |
65 | + |
66 | .PHONY: build lint clean |
67 | |
68 | === modified file 'buildout.cfg' |
69 | --- buildout.cfg 2009-10-30 16:58:21 +0000 |
70 | +++ buildout.cfg 2009-11-13 15:43:10 +0000 |
71 | @@ -2,12 +2,15 @@ |
72 | develop = . |
73 | parts = |
74 | scripts |
75 | + tags |
76 | test |
77 | |
78 | unzip = true |
79 | eggs-directory = eggs |
80 | download-cache = download-cache |
81 | |
82 | +extends = versions.cfg |
83 | + |
84 | # Disable this option temporarily if you want buildout to find software |
85 | # dependencies *other* than those in our download-cache. Once you have the |
86 | # desired software, reenable this option (and check in the new software to |
87 | @@ -22,22 +25,16 @@ |
88 | |
89 | [scripts] |
90 | recipe = zc.recipe.egg |
91 | +eggs = |
92 | + cssutils |
93 | + lazr-js |
94 | interpreter = py |
95 | + |
96 | +[tags] |
97 | +recipe = z3c.recipe.tag:tags |
98 | eggs = lazr-js |
99 | |
100 | -[versions] |
101 | -# Alphabetical, case-insensitive, please! :-) |
102 | -bzr = 2.0.0 |
103 | -lazr.testing = 0.1.1 |
104 | -mocker = 0.10.1 |
105 | -setuptools = 0.6c9 |
106 | -zc.buildout = 1.4.1 |
107 | -zc.recipe.egg = 1.2.2 |
108 | -zc.recipe.testrunner = 1.2.0 |
109 | -zope.exceptions = 3.5.2 |
110 | -zope.interface = 3.5.1 |
111 | -zope.testing = 3.8.1 |
112 | - |
113 | [test] |
114 | recipe = zc.recipe.testrunner |
115 | +initialization = os.environ.setdefault("JSTESTDRIVER", "java -jar ${buildout:directory}/download-cache/JsTestDriver.jar") |
116 | eggs = lazr-js |
117 | |
118 | === modified file 'examples/anim/index.html' |
119 | --- examples/anim/index.html 2009-10-22 20:22:12 +0000 |
120 | +++ examples/anim/index.html 2009-11-13 15:43:10 +0000 |
121 | @@ -39,6 +39,28 @@ |
122 | anim.run(); |
123 | }, '#example button'); |
124 | |
125 | + Y.on('click', function(ev) { |
126 | + var id = ev.target ? ev.target.getAttribute('id') : null; |
127 | + if (!id) { |
128 | + return; // Just in case. |
129 | + }; |
130 | + |
131 | + var fn; |
132 | + switch(id) { |
133 | + case 'one': node = Y.one('#example2-table-tr-td1'); break; |
134 | + case 'two': node = Y.one('#example2-table-tr-td2'); break; |
135 | + case 'both': node = Y.all('#example2-table-tr td'); break; |
136 | + default: |
137 | + Y.fail( |
138 | + "Oops! The button with id '" + id + "' is unrecognized."); |
139 | + return; |
140 | + }; |
141 | + |
142 | + var anim = Y.lazr.anim.green_flash({ node: node }); |
143 | + Y.log("Running " + id + " fade-in.", 'info'); |
144 | + anim.run(); |
145 | + }, '#example2 button'); |
146 | + |
147 | }); |
148 | |
149 | </script> |
150 | @@ -79,6 +101,8 @@ |
151 | }); |
152 | </pre> |
153 | |
154 | +<h1>Configuration Options</h1> |
155 | + |
156 | <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> |
157 | |
158 | <pre> |
159 | @@ -92,5 +116,47 @@ |
160 | blue_flash.run(); |
161 | </pre> |
162 | |
163 | +<h1>Multiple Elements</h1> |
164 | + |
165 | +<div id="example2"> |
166 | + <table border="1" id="example2-table"> |
167 | + <tr id="example2-table-tr"> |
168 | + <td id="example2-table-tr-td1">Cell One</td> |
169 | + <td id="example2-table-tr-td2">Cell Two</td> |
170 | + </tr> |
171 | + </table> |
172 | + <button id="one">Flash Cell One</button> |
173 | + <button id="two">Flash Cell Two</button> |
174 | + <button id="both">Flash Both Cells</button> |
175 | +</div> |
176 | + |
177 | +<p><code>node</code> can be one of: a selector (for single or multiple elements, i.e. |
178 | +<code>'#target'</code> or <code>'#target td'</code>), an individual Node object, or a |
179 | +NodeList, and the animation will occur in all nodes concurrently.</p> |
180 | + |
181 | +<pre> |
182 | +# flash a table row |
183 | + |
184 | +var blue_flash = Y.lazr.anim.flash_in({ |
185 | + node: '#target-table-row td', |
186 | + from: { backgroundColor: '#000099' } // Override the default |
187 | +}); |
188 | + |
189 | +blue_flash.run(); |
190 | +</pre> |
191 | + |
192 | +is equivalent to |
193 | + |
194 | +<pre> |
195 | +# flash a table row |
196 | + |
197 | +var blue_flash = Y.lazr.anim.flash_in({ |
198 | + node: Y.all('#target-table-row td'), |
199 | + from: { backgroundColor: '#000099' } // Override the default |
200 | +}); |
201 | + |
202 | +blue_flash.run(); |
203 | +</pre> |
204 | + |
205 | </body> |
206 | </html> |
207 | |
208 | === modified file 'examples/autocomplete/index.html' |
209 | --- examples/autocomplete/index.html 2009-10-22 20:22:12 +0000 |
210 | +++ examples/autocomplete/index.html 2009-11-13 15:43:10 +0000 |
211 | @@ -269,6 +269,7 @@ |
212 | |
213 | <h1>A Simple auto-complete Widget</h1> |
214 | |
215 | +<h2>Demonstration</h2> |
216 | <div id="example"> |
217 | <label for="ac-input">Enter a country name:</label> |
218 | <input id="ac-input" type="text" value="" /> |
219 | @@ -313,5 +314,35 @@ |
220 | </script> |
221 | </div> |
222 | |
223 | +<h2>Page Setup</h2> |
224 | +<div> |
225 | + <h3>Javascript</h3> |
226 | + Add the following javascript and css tags into your page. |
227 | + <pre> |
228 | + <script type="text/javascript" src="../../build/yui/current/build/yui/yui.js"></script> |
229 | + <script type="text/javascript" src="../../build/autocomplete/autocomplete.js"></script> |
230 | + </pre> |
231 | + |
232 | + <p> |
233 | + The only existing markup required for the autocomplete widget is an input |
234 | + box. |
235 | + <pre> |
236 | + <input id="input-box" type="text" value="" /> |
237 | + </pre> |
238 | + </p> |
239 | + |
240 | +</div> |
241 | + |
242 | +<h2>Widget Setup</h2> |
243 | +<div> |
244 | + The AutoComplete widget requires two ATTRs on creation: a node id and an |
245 | + array containing data. |
246 | + <pre> |
247 | + var autocomplete = new Y.lazr.AutoComplete({ |
248 | + input: '#input-box', |
249 | + data: ['Mike', 'Fred', 'Barney'] |
250 | + }); |
251 | + autocomplete.render(); |
252 | + </pre> |
253 | </body> |
254 | </html> |
255 | |
256 | === modified file 'examples/inlineeditor/index.html' |
257 | --- examples/inlineeditor/index.html 2009-10-30 16:58:21 +0000 |
258 | +++ examples/inlineeditor/index.html 2009-11-13 15:43:10 +0000 |
259 | @@ -13,9 +13,6 @@ |
260 | relative paths to images. |
261 | --> |
262 | <link type="text/css" rel="stylesheet" href="../../build/lazr-sam.css"></link> |
263 | - <link type="text/css" rel="stylesheet" href="../../build/lazr/assets/skins/sam/lazr.css"></link> |
264 | - <link type="text/css" rel="stylesheet" href="../../build/inlineedit/assets/skins/sam/editor.css"></link> |
265 | - <link rel="stylesheet" type="text/css" href="../../build/inlineedit/assets/skins/sam/editor-skin.css" /> |
266 | <style> |
267 | #example { |
268 | margin-left: 20px; |
269 | |
270 | === modified file 'examples/picker/index.html' |
271 | --- examples/picker/index.html 2009-10-22 20:22:12 +0000 |
272 | +++ examples/picker/index.html 2009-11-13 15:43:10 +0000 |
273 | @@ -65,6 +65,8 @@ |
274 | |
275 | |
276 | var picker = new Y.Picker({ |
277 | + picker_activator: '#show-widget', |
278 | + clear_on_cancel: true, |
279 | align: { |
280 | points: [Y.WidgetPositionExt.CC, Y.WidgetPositionExt.CC] |
281 | }, |
282 | @@ -129,9 +131,6 @@ |
283 | }); |
284 | }); |
285 | |
286 | - Y.on('click', function () { |
287 | - picker.show(); |
288 | - }, '#show-widget'); |
289 | Y.on('change', function () { |
290 | picker.set( |
291 | 'min_search_chars', |
292 | |
293 | === modified file 'setup.py' |
294 | --- setup.py 2009-11-03 21:59:24 +0000 |
295 | +++ setup.py 2009-11-13 15:43:10 +0000 |
296 | @@ -6,7 +6,7 @@ |
297 | import sys |
298 | from setuptools import setup, find_packages |
299 | |
300 | -__version__ = '0.9DEV' |
301 | +__version__ = '0.9.1DEV' |
302 | |
303 | |
304 | setup( |
305 | @@ -14,7 +14,7 @@ |
306 | namespace_packages=['lazr'], |
307 | version=__version__, |
308 | packages=['lazr', 'lazrjs'], |
309 | - py_modules=['jsmin', 'slimmer'], |
310 | + py_modules=['jsmin'], |
311 | package_dir={ |
312 | 'lazrjs': 'src-js/lazrjs', |
313 | '': 'src-py'}, |
314 | @@ -26,6 +26,7 @@ |
315 | license='GPL v3', |
316 | install_requires=[ |
317 | 'bzr', |
318 | + 'cssutils', |
319 | 'lazr.testing', |
320 | 'setuptools', |
321 | ], |
322 | |
323 | === modified file 'src-js/lazrjs/anim/anim.js' |
324 | --- src-js/lazrjs/anim/anim.js 2009-03-12 02:55:06 +0000 |
325 | +++ src-js/lazrjs/anim/anim.js 2009-11-13 15:43:10 +0000 |
326 | @@ -13,31 +13,8 @@ |
327 | */ |
328 | Y.lazr.anim.flash_in = function(cfg) { |
329 | var acfg = Y.merge(Y.lazr.anim.flash_in.defaults, cfg); |
330 | - var anim = new Y.Anim(acfg); |
331 | - |
332 | - // We need to validate the config afterwards because some of the |
333 | - // properties may be dynamic. |
334 | - var to = acfg.to; |
335 | - |
336 | - // Check the background color to make sure it isn't 'transparent'. |
337 | - if (to && typeof to.backgroundColor === 'function') { |
338 | - var bg = to.backgroundColor.call(anim, anim.get('node')); |
339 | - if (bg == 'transparent') { |
340 | - Y.fail("Can not animate to a 'transparent' background " + |
341 | - "in '" + anim + "'"); |
342 | - } |
343 | - } |
344 | - |
345 | - // Reset the background color. This is normally only necessary when the |
346 | - // original background color of the node or its parent are not white, |
347 | - // since we normally fade to white. |
348 | - var original_bg = null; |
349 | - anim.on('start', function () { |
350 | - original_bg = anim.get('node').getStyle('backgroundColor'); |
351 | - }); |
352 | - anim.on('end', function () { |
353 | - anim.get('node').setStyle('backgroundColor', original_bg); |
354 | - }); |
355 | + var anim = new Y.lazr.anim.Anim(acfg); |
356 | + |
357 | return anim; |
358 | }; |
359 | |
360 | @@ -81,4 +58,91 @@ |
361 | from: { backgroundColor: '#FF6666' } |
362 | }; |
363 | |
364 | -}, '0.1', {requires:['anim']}); |
365 | +var resolveNodeListFrom = function(protonode) { |
366 | + if (typeof protonode === 'string') { |
367 | + // selector |
368 | + return Y.all(protonode); |
369 | + } else if (protonode._node !== undefined) { |
370 | + // Node |
371 | + return new Y.NodeList([protonode]); |
372 | + } else if (protonode._nodes !== undefined) { |
373 | + // NodeList |
374 | + return protonode; |
375 | + } |
376 | + |
377 | + throw('Not a selector, Node, or NodeList'); |
378 | +}; |
379 | + |
380 | +/* |
381 | + * The Anim widget similar to Y.anim.Anim, but supports operating on a NodeList |
382 | + * |
383 | + * @class Anim |
384 | + */ |
385 | +Anim = function(cfg) { |
386 | + var nodelist = resolveNodeListFrom(cfg.node); |
387 | + this._anims = []; |
388 | + var self = this; |
389 | + var config = cfg; |
390 | + Y.each(nodelist, |
391 | + function(n) { |
392 | + var ncfg = Y.merge(config, {node: n}); |
393 | + var anim = new Y.Anim(ncfg); |
394 | + // We need to validate the config |
395 | + // afterwards because some of the |
396 | + // properties may be dynamic. |
397 | + var to = ncfg.to; |
398 | + |
399 | + // Check the background color to make sure |
400 | + // it isn't 'transparent'. |
401 | + if (to && typeof to.backgroundColor === 'function') { |
402 | + var bg = to.backgroundColor.call( |
403 | + anim, anim.get('node')); |
404 | + if (bg == 'transparent') { |
405 | + Y.error("Can not animate to a 'transparent' background " + |
406 | + "in '" + anim + "'"); |
407 | + } |
408 | + } |
409 | + |
410 | + // Reset the background color. This is |
411 | + // normally only necessary when the |
412 | + // original background color of the node |
413 | + // or its parent are not white, since we |
414 | + // normally fade to white. |
415 | + var original_bg = null; |
416 | + anim.on('start', function () { |
417 | + original_bg = anim.get('node').getStyle('backgroundColor'); |
418 | + }); |
419 | + anim.on('end', function () { |
420 | + anim.get('node').setStyle('backgroundColor', original_bg); |
421 | + }); |
422 | + |
423 | + self._anims.push(anim); |
424 | + } |
425 | + ); |
426 | +}; |
427 | + |
428 | +Anim.prototype = { |
429 | + run: function() { |
430 | + // delegate all behavior back to our collection of Anims |
431 | + Y.each(this._anims, |
432 | + function(n) { |
433 | + n.run(); |
434 | + } |
435 | + ); |
436 | + }, |
437 | + |
438 | + on: function() { |
439 | + // delegate all behavior back to our collection of Anims |
440 | + var args = arguments; |
441 | + Y.each(this._anims, |
442 | + function(n) { |
443 | + n.on.apply(n, args); |
444 | + } |
445 | + ); |
446 | + } |
447 | +}; |
448 | + |
449 | +Y.lazr.anim.Anim = Anim; |
450 | +Y.lazr.anim.resolveNodeListFrom = resolveNodeListFrom; |
451 | + |
452 | +}, '0.1', {requires:['base', 'node', 'anim']}); |
453 | |
454 | === added directory 'src-js/lazrjs/anim/tests' |
455 | === added file 'src-js/lazrjs/anim/tests/anim.html' |
456 | --- src-js/lazrjs/anim/tests/anim.html 1970-01-01 00:00:00 +0000 |
457 | +++ src-js/lazrjs/anim/tests/anim.html 2009-11-13 15:43:10 +0000 |
458 | @@ -0,0 +1,27 @@ |
459 | +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" |
460 | + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
461 | +<html> |
462 | + <head> |
463 | + <title>Anim</title> |
464 | + |
465 | + <!-- YUI 3.0 Setup --> |
466 | + <script type="text/javascript" src="../../yui/current/build/yui/yui.js"></script> |
467 | + <link rel="stylesheet" href="../../yui/current/build/cssreset/reset.css"/> |
468 | + <link rel="stylesheet" href="../../yui/current/build/cssfonts/fonts.css"/> |
469 | + <link rel="stylesheet" href="../../yui/current/build/cssbase/base.css"/> |
470 | + |
471 | + <!-- The module under test --> |
472 | + <script type="text/javascript" src="../../anim/anim.js"></script> |
473 | + <script type="text/javascript" src="../../lazr/lazr.js"></script> |
474 | + <script type="text/javascript" src="../../testing/testing.js"></script> |
475 | + |
476 | + <!-- The test suite --> |
477 | + <script type="text/javascript" src="anim.js"></script> |
478 | + |
479 | + <link rel="stylesheet" href="../../testing/assets/testlogger.css"/> |
480 | +</head> |
481 | +<body class="yui-skin-sam"> |
482 | + |
483 | +<div id="log"></div> |
484 | +</body> |
485 | +</html> |
486 | |
487 | === added file 'src-js/lazrjs/anim/tests/anim.js' |
488 | --- src-js/lazrjs/anim/tests/anim.js 1970-01-01 00:00:00 +0000 |
489 | +++ src-js/lazrjs/anim/tests/anim.js 2009-11-13 15:43:10 +0000 |
490 | @@ -0,0 +1,191 @@ |
491 | +/* Copyright (c) 2009, Canonical Ltd. All rights reserved. */ |
492 | + |
493 | +YUI({ |
494 | + base: '../../yui/current/build/', |
495 | + filter: 'raw', |
496 | + combine: false |
497 | + }).use('lazr.anim', 'lazr.testing.runner', 'node', |
498 | + 'event', 'event-simulate', 'console', function(Y) { |
499 | + |
500 | +var Assert = Y.Assert; // For easy access to isTrue(), etc. |
501 | + |
502 | +var suite = new Y.Test.Suite("Anim Tests"); |
503 | + |
504 | +suite.add(new Y.Test.Case({ |
505 | + |
506 | + name: 'anim_basics', |
507 | + |
508 | + setUp: function() { |
509 | + this.workspace = Y.one('#workspace'); |
510 | + if (!this.workspace){ |
511 | + Y.one(document.body).appendChild(Y.Node.create( |
512 | + '<div id="workspace">' |
513 | + + '<table id="anim-table">' |
514 | + + '<tr id="anim-table-tr">' |
515 | + + '<td id="anim-table-td1" style="background: #eeeeee">foo</td>' |
516 | + + '<td id="anim-table-td2" style="background: #eeeeee">bar</td>' |
517 | + + '</tr></table></div>')); |
518 | + this.workspace = Y.one('#workspace'); |
519 | + } |
520 | + }, |
521 | + |
522 | + tearDown: function() { |
523 | + this.workspace.get('parentNode').removeChild(this.workspace); |
524 | + }, |
525 | + |
526 | + test_resolveNodeListFrom_selector: function() { |
527 | + var nodelist = Y.lazr.anim.resolveNodeListFrom('#anim-table-td1'); |
528 | + var nodelist_nodes = (nodelist._nodes !== undefined); |
529 | + Assert.isTrue(nodelist_nodes, 'Not a nodelist from a selector'); |
530 | + }, |
531 | + |
532 | + test_resolveNodeListFrom_node: function() { |
533 | + var node = Y.one('#anim-table-td1'); |
534 | + var nodelist = Y.lazr.anim.resolveNodeListFrom(node); |
535 | + var nodelist_nodes = (nodelist._nodes !== undefined); |
536 | + Assert.isTrue(nodelist_nodes, 'Not a nodelist from a Node'); |
537 | + }, |
538 | + |
539 | + test_resolveNodeListFrom_node_list: function() { |
540 | + var nodelist = Y.all('#anim-table td'); |
541 | + var nodelist = Y.lazr.anim.resolveNodeListFrom(nodelist); |
542 | + var nodelist_nodes = (nodelist._nodes !== undefined); |
543 | + Assert.isTrue(nodelist_nodes, 'Not a nodelist from a NodeList'); |
544 | + }, |
545 | + |
546 | + test_resolveNodeListFrom_anythine_else: function() { |
547 | + var succeed = true; |
548 | + try { |
549 | + var nodelist = Y.lazr.anim.resolveNodeListFrom( |
550 | + {crazy: true, broken: 'definitely'}); |
551 | + } catch(e) { |
552 | + succeed = false; |
553 | + } |
554 | + Assert.isFalse(succeed, "Somehow, we're cleverer than we thought."); |
555 | + }, |
556 | + |
557 | + test_green_flash_td1: function() { |
558 | + // works as expected on a single node, |
559 | + // without coercion into a NodeList here |
560 | + var node = Y.one('#anim-table-td1'); |
561 | + var bgcolor = node.getStyle('backgroundColor'); |
562 | + var anim = Y.lazr.anim.green_flash( |
563 | + {node: node, |
564 | + to: {backgroundColor: bgcolor}, |
565 | + duration: 0.2} |
566 | + ); |
567 | + anim.run(); |
568 | + this.wait(function() { |
569 | + Assert.areEqual( |
570 | + bgcolor, |
571 | + node.getStyle('backgroundColor'), |
572 | + 'background colors do not match' |
573 | + ); |
574 | + }, 500 |
575 | + ); |
576 | + }, |
577 | + |
578 | + test_green_flash_td1_by_selector: function() { |
579 | + // works as expected on a single node selector, |
580 | + // without coercion into a NodeList here |
581 | + var node = Y.one('#anim-table-td1'); |
582 | + var bgcolor = node.getStyle('backgroundColor'); |
583 | + var anim = Y.lazr.anim.green_flash( |
584 | + {node: '#anim-table-td1', |
585 | + to: {backgroundColor: bgcolor}, |
586 | + duration: 0.2} |
587 | + ); |
588 | + anim.run(); |
589 | + this.wait(function() { |
590 | + Assert.areEqual( |
591 | + bgcolor, |
592 | + node.getStyle('backgroundColor'), |
593 | + 'background colors do not match' |
594 | + ); |
595 | + }, 500 |
596 | + ); |
597 | + }, |
598 | + |
599 | + test_green_flash_multi: function() { |
600 | + // works with a native NodeList as well |
601 | + var nodelist = Y.all('#anim-table td'); |
602 | + var red = '#ff0000'; |
603 | + var backgrounds = []; |
604 | + Y.each(nodelist, function(n) { |
605 | + backgrounds.push({bg: n.getStyle('backgroundColor'), node: n}); |
606 | + }); |
607 | + var anim = Y.lazr.anim.green_flash( |
608 | + {node: nodelist, |
609 | + to: {backgroundColor: red}, |
610 | + duration: 5} |
611 | + ); |
612 | + anim.run(); |
613 | + this.wait(function() { |
614 | + Assert.areNotEqual( |
615 | + backgrounds[0].node.getStyle('backgroundColor'), |
616 | + red, |
617 | + 'background of 0 has mysteriously jumped to the end color.' |
618 | + ); |
619 | + Assert.areNotEqual( |
620 | + backgrounds[1].node.getStyle('backgroundColor'), |
621 | + red, |
622 | + 'background of 1 has mysteriously jumped to the end color.' |
623 | + ); |
624 | + Assert.areNotEqual( |
625 | + backgrounds[0].node.getStyle('backgroundColor'), |
626 | + backgrounds[0].bg, |
627 | + 'background of 0 has not changed at all.' |
628 | + ); |
629 | + Assert.areNotEqual( |
630 | + backgrounds[1].node.getStyle('backgroundColor'), |
631 | + backgrounds[1].bg, |
632 | + 'background of 1 has not changed at all.' |
633 | + ); |
634 | + }, 1500 |
635 | + ); |
636 | + }, |
637 | + |
638 | + test_green_flash_multi_by_selector: function() { |
639 | + // works with a native NodeList as well |
640 | + var nodelist = Y.all('#anim-table td'); |
641 | + var red = '#ff0000'; |
642 | + var backgrounds = []; |
643 | + Y.each(nodelist, function(n) { |
644 | + backgrounds.push({bg: n.getStyle('backgroundColor'), node: n}); |
645 | + }); |
646 | + var anim = Y.lazr.anim.green_flash( |
647 | + {node: '#anim-table td', |
648 | + to: {backgroundColor: red}, |
649 | + duration: 2} |
650 | + ); |
651 | + anim.run(); |
652 | + this.wait(function() { |
653 | + Assert.areNotEqual( |
654 | + backgrounds[0].node.getStyle('backgroundColor'), |
655 | + red, |
656 | + 'background of 0 has mysteriously jumped to the end color.' |
657 | + ); |
658 | + Assert.areNotEqual( |
659 | + backgrounds[1].node.getStyle('backgroundColor'), |
660 | + red, |
661 | + 'background of 1 has mysteriously jumped to the end color.' |
662 | + ); |
663 | + Assert.areNotEqual( |
664 | + backgrounds[0].node.getStyle('backgroundColor'), |
665 | + backgrounds[0].bg, |
666 | + 'background of 0 has not changed at all.' |
667 | + ); |
668 | + Assert.areNotEqual( |
669 | + backgrounds[1].node.getStyle('backgroundColor'), |
670 | + backgrounds[1].bg, |
671 | + 'background of 1 has not changed at all.' |
672 | + ); |
673 | + }, 500 |
674 | + ); |
675 | + } |
676 | + })); |
677 | + |
678 | +Y.lazr.testing.Runner.add(suite); |
679 | +Y.lazr.testing.Runner.run(); |
680 | + |
681 | +}); |
682 | |
683 | === modified file 'src-js/lazrjs/choiceedit/choiceedit.js' |
684 | --- src-js/lazrjs/choiceedit/choiceedit.js 2009-10-23 18:21:21 +0000 |
685 | +++ src-js/lazrjs/choiceedit/choiceedit.js 2009-11-13 15:43:10 +0000 |
686 | @@ -180,15 +180,7 @@ |
687 | } else { |
688 | var clickable_element = this.get('editicon'); |
689 | } |
690 | - clickable_element.on("mousedown", this._onMouseDown, this); |
691 | - if (Y.UA.opera && !this.get('clickable_content')) { |
692 | - // In Opera, cancelling the mousedown event for an <a> tag |
693 | - // doesn't prevent the link from loading, so we need to add |
694 | - // an on-click handler to make sure the on-click event is |
695 | - // cancelled explicitly. |
696 | - Y.get(this.get("contentBox")).on( |
697 | - "click", function (e) { e.halt(); }, this); |
698 | - } |
699 | + clickable_element.on("click", this.onClick, this); |
700 | |
701 | this.after("valueChange", function(e) { |
702 | this.syncUI(); |
703 | @@ -235,13 +227,13 @@ |
704 | }, |
705 | |
706 | /** |
707 | - * Handle mousedown and create the ChoiceList to allow user to |
708 | + * Handle click and create the ChoiceList to allow user to |
709 | * select an item |
710 | * |
711 | - * @method _onMouseDown |
712 | + * @method onClick |
713 | * @private |
714 | */ |
715 | - _onMouseDown: function(e) { |
716 | + onClick: function(e) { |
717 | |
718 | // Only continue if the down button is the left one. |
719 | if (e.button != LEFT_MOUSE_BUTTON) { |
720 | |
721 | === modified file 'src-js/lazrjs/choiceedit/tests/choiceedit.js' |
722 | --- src-js/lazrjs/choiceedit/tests/choiceedit.js 2009-10-22 18:37:47 +0000 |
723 | +++ src-js/lazrjs/choiceedit/tests/choiceedit.js 2009-11-13 15:43:10 +0000 |
724 | @@ -104,7 +104,7 @@ |
725 | }, |
726 | |
727 | test_clicking_creates_choicelist: function() { |
728 | - simulate(this.choice_edit.get('boundingBox'), '.value', 'mousedown'); |
729 | + simulate(this.choice_edit.get('boundingBox'), '.value', 'click'); |
730 | Assert.isNotNull(this.choice_edit._choice_list, |
731 | "ChoiceList object is not created"); |
732 | Assert.isNotNull(Y.get(document).query(".yui-ichoicelist"), |
733 | @@ -113,13 +113,13 @@ |
734 | |
735 | test_right_clicking_doesnt_create_choicelist: function() { |
736 | simulate(this.choice_edit.get('boundingBox'), |
737 | - '.value', 'mousedown', { button: 2 }); |
738 | + '.value', 'click', { button: 2 }); |
739 | Assert.isNull(Y.get(document).query(".yui-ichoicelist"), |
740 | "ChoiceList created when the right mouse button was clicked"); |
741 | }, |
742 | |
743 | test_choicelist_has_correct_values: function() { |
744 | - simulate(this.choice_edit.get('boundingBox'), '.value', 'mousedown'); |
745 | + simulate(this.choice_edit.get('boundingBox'), '.value', 'click'); |
746 | var that = this; |
747 | Y.each(this.config.items, function(configitem) { |
748 | var found = false; |
749 | @@ -140,7 +140,7 @@ |
750 | }, |
751 | |
752 | test_choicelist_html_has_correct_values: function() { |
753 | - simulate(this.choice_edit.get('boundingBox'), '.value', 'mousedown'); |
754 | + simulate(this.choice_edit.get('boundingBox'), '.value', 'click'); |
755 | var configcount = this.config.items.length; |
756 | var choicelist_lis = Y.get(document).queryAll(".yui-ichoicelist li"); |
757 | Assert.areEqual(choicelist_lis.size(), configcount, |
758 | @@ -163,7 +163,7 @@ |
759 | }, |
760 | |
761 | test_choicelist_html_has_disabled: function() { |
762 | - simulate(this.choice_edit.get('boundingBox'), '.value', 'mousedown'); |
763 | + simulate(this.choice_edit.get('boundingBox'), '.value', 'click'); |
764 | var configcount = this.config.items.length; |
765 | var choicelist_lis = Y.get(document).queryAll(".yui-ichoicelist li"); |
766 | // confirm that disabled LIs are disabled |
767 | @@ -183,7 +183,7 @@ |
768 | }, |
769 | |
770 | test_choicelist_html_has_current: function() { |
771 | - simulate(this.choice_edit.get('boundingBox'), '.value', 'mousedown'); |
772 | + simulate(this.choice_edit.get('boundingBox'), '.value', 'click'); |
773 | var configcount = this.config.items.length; |
774 | var choicelist_lis = Y.get(document).queryAll(".yui-ichoicelist li"); |
775 | // confirm that current value has an LI with current style |
776 | @@ -206,7 +206,7 @@ |
777 | }, |
778 | |
779 | test_clicking_choicelist_item_fires_signal: function() { |
780 | - simulate(this.choice_edit.get('boundingBox'), '.value', 'mousedown'); |
781 | + simulate(this.choice_edit.get('boundingBox'), '.value', 'click'); |
782 | var that = this; |
783 | this.choice_edit._choice_list.on("valueChosen", function() { |
784 | that.resume(); |
785 | @@ -221,7 +221,7 @@ |
786 | }, |
787 | |
788 | test_clicking_choicelist_item_does_green_flash: function() { |
789 | - simulate(this.choice_edit.get('boundingBox'), '.value', 'mousedown'); |
790 | + simulate(this.choice_edit.get('boundingBox'), '.value', 'click'); |
791 | var that = this; |
792 | var green_flash = Y.lazr.anim.green_flash; |
793 | Y.lazr.anim.green_flash = function() { |
794 | @@ -241,7 +241,7 @@ |
795 | test_clicking_choicelist_item_sets_page_value: function() { |
796 | var st = Y.get(document).query("#thestatus"); |
797 | // The page value is set to item.name of the selected item. |
798 | - simulate(this.choice_edit.get('boundingBox'), '.value', 'mousedown'); |
799 | + simulate(this.choice_edit.get('boundingBox'), '.value', 'click'); |
800 | simulate(this.choice_edit._choice_list.get('boundingBox'), |
801 | 'li a[href$=fixreleased]', 'click'); |
802 | Assert.areEqual("Fix Released", st.query(".value").get("innerHTML"), |
803 | @@ -254,7 +254,7 @@ |
804 | // By default, the page value is set to item.name of the |
805 | // selected item, but this can be overridden by specifying |
806 | // item.source_name. |
807 | - simulate(this.choice_edit.get('boundingBox'), '.value', 'mousedown'); |
808 | + simulate(this.choice_edit.get('boundingBox'), '.value', 'click'); |
809 | var choice_list_bb = this.choice_edit._choice_list.get('boundingBox'); |
810 | var stalled_in_list = choice_list_bb.query('li a[href$=stalled]'); |
811 | Assert.areEqual( |
812 | @@ -303,7 +303,7 @@ |
813 | }, |
814 | |
815 | test_clicking_content_doesnt_create_choicelist: function() { |
816 | - simulate(this.choice_edit.get('boundingBox'), '.value', 'mousedown'); |
817 | + simulate(this.choice_edit.get('boundingBox'), '.value', 'click'); |
818 | Assert.isUndefined(this.choice_edit._choice_list, |
819 | "ChoiceList object is created"); |
820 | Assert.isNull(Y.get(document).query(".yui-ichoicelist"), |
821 | @@ -311,7 +311,7 @@ |
822 | }, |
823 | |
824 | test_clicking_icon_creates_choicelist: function() { |
825 | - simulate(this.choice_edit.get('boundingBox'), '.editicon', 'mousedown'); |
826 | + simulate(this.choice_edit.get('boundingBox'), '.editicon', 'click'); |
827 | Assert.isNotUndefined(this.choice_edit._choice_list, |
828 | "ChoiceList object is not being created"); |
829 | Assert.isNotNull(Y.get(document).query(".yui-ichoicelist"), |
830 | @@ -359,7 +359,7 @@ |
831 | }, |
832 | |
833 | test_choicelist_html_has_current: function() { |
834 | - simulate(this.choice_edit.get('boundingBox'), '.value', 'mousedown'); |
835 | + simulate(this.choice_edit.get('boundingBox'), '.value', 'click'); |
836 | var configcount = this.config.items.length; |
837 | var choicelist_lis = Y.get(document).queryAll(".yui-ichoicelist li"); |
838 | |
839 | @@ -390,7 +390,7 @@ |
840 | simulate(this.choice_edit._choice_list.get('boundingBox'), |
841 | 'li a[href$=new]', 'click'); |
842 | this.wait(3000, function() { |
843 | - simulate(this.choice_edit.get('boundingBox'), '.value', 'mousedown'); |
844 | + simulate(this.choice_edit.get('boundingBox'), '.value', 'click'); |
845 | asserted = false; |
846 | choicelist_lis.each(test_li); |
847 | Assert.isTrue(asserted, "There was no current LI item"); |
848 | @@ -470,7 +470,7 @@ |
849 | "Edit icon is visible when it shouldn't be"); |
850 | |
851 | simulate(this.null_choice_edit.get('boundingBox'), |
852 | - '.value', 'mousedown'); |
853 | + '.value', 'click'); |
854 | simulate(this.null_choice_edit._choice_list.get('boundingBox'), |
855 | 'li a[href$=groucho]', 'click'); |
856 | this.null_choice_edit._uiClearWaiting(); |
857 | @@ -496,7 +496,7 @@ |
858 | "Selected value isn't null"); |
859 | |
860 | simulate(this.null_choice_edit.get('boundingBox'), |
861 | - '.value', 'mousedown'); |
862 | + '.value', 'click'); |
863 | var remove_action_present = false; |
864 | this.null_choice_edit._choice_list.get( |
865 | 'boundingBox').queryAll('li a').each(function(item) { |
866 | @@ -517,7 +517,7 @@ |
867 | "getInput() did not return the current value"); |
868 | // Simulate choosing a null value and check that getInput() |
869 | // returns the new value. |
870 | - this.null_choice_edit._onMouseDown({button: 1, halt: function(){}}); |
871 | + this.null_choice_edit.onClick({button: 1, halt: function(){}}); |
872 | this.null_choice_edit._choice_list.fire('valueChosen', null); |
873 | Assert.areEqual( |
874 | null, |
875 | |
876 | === modified file 'src-js/lazrjs/inlineedit/assets/skins/sam/editor-skin.css' |
877 | --- src-js/lazrjs/inlineedit/assets/skins/sam/editor-skin.css 2009-10-28 00:27:52 +0000 |
878 | +++ src-js/lazrjs/inlineedit/assets/skins/sam/editor-skin.css 2009-11-13 15:43:10 +0000 |
879 | @@ -2,7 +2,7 @@ |
880 | |
881 | .yui-skin-sam .yui-ieditor-errors { |
882 | padding: 0.2em 0 0.5em 0.5em; |
883 | - font: sans-serif; |
884 | + font-family: sans-serif; |
885 | font-size: 0.5em; |
886 | color: red; |
887 | } |
888 | @@ -66,7 +66,7 @@ |
889 | } |
890 | |
891 | .yui-skin-sam .yui-ieditor-waiting .yui-ieditor-btns { |
892 | - background: url(../../../../lazr/assets/skins/sam/spinner.gif) 0.2em 0em no-repeat; |
893 | + background: url("../../../../lazr/assets/skins/sam/spinner.gif") 0.2em 0em no-repeat; |
894 | } |
895 | |
896 | /* |
897 | |
898 | === modified file 'src-js/lazrjs/inlineedit/editor.js' |
899 | --- src-js/lazrjs/inlineedit/editor.js 2009-10-30 16:58:21 +0000 |
900 | +++ src-js/lazrjs/inlineedit/editor.js 2009-11-13 15:43:10 +0000 |
901 | @@ -1154,6 +1154,7 @@ |
902 | node: cancel, |
903 | easing: Y.Easing.easeOut, |
904 | duration: 0.2, |
905 | + from: { left: 0 }, |
906 | to: { left: -4 } |
907 | }); |
908 | var self = this; |
909 | |
910 | === modified file 'src-js/lazrjs/overlay/assets/skins/sam/pretty-overlay-skin.css' |
911 | --- src-js/lazrjs/overlay/assets/skins/sam/pretty-overlay-skin.css 2009-04-21 16:25:06 +0000 |
912 | +++ src-js/lazrjs/overlay/assets/skins/sam/pretty-overlay-skin.css 2009-11-13 15:43:10 +0000 |
913 | @@ -141,7 +141,7 @@ |
914 | |
915 | .yui-pretty-overlay .step-off, |
916 | .yui-pretty-overlay .step-offb { |
917 | - background: grey url('images/bg_steps-estatus.gif') bottom repeat-x; |
918 | + background: gray url('images/bg_steps-estatus.gif') bottom repeat-x; |
919 | } |
920 | |
921 | .yui-pretty-overlay .yui-widget-bd { |
922 | |
923 | === modified file 'src-js/lazrjs/overlay/overlay.js' |
924 | --- src-js/lazrjs/overlay/overlay.js 2009-10-23 18:24:21 +0000 |
925 | +++ src-js/lazrjs/overlay/overlay.js 2009-11-13 15:43:10 +0000 |
926 | @@ -209,11 +209,10 @@ |
927 | var visible = this.get('visible'); |
928 | if (visible) { |
929 | Y.get('body').appendChild(this._blocking_div); |
930 | - this._doc_kp_handler = Y.on('keypress', function(e) { |
931 | - if (e.keyCode == ESCAPE) { |
932 | + // Handle Escape (code 27) on keydown. |
933 | + this._doc_kp_handler = Y.on('key', function() { |
934 | self.fire(CANCEL); |
935 | - } |
936 | - }, document); |
937 | + }, document, 'down:27'); |
938 | } else { |
939 | this._removeBlockingDiv(); |
940 | } |
941 | |
942 | === modified file 'src-js/lazrjs/overlay/tests/overlay.js' |
943 | --- src-js/lazrjs/overlay/tests/overlay.js 2009-10-22 18:37:47 +0000 |
944 | +++ src-js/lazrjs/overlay/tests/overlay.js 2009-11-13 15:43:10 +0000 |
945 | @@ -51,6 +51,12 @@ |
946 | cleanup_widget(this.overlay); |
947 | }, |
948 | |
949 | + hitEscape: function() { |
950 | + simulate(this.overlay.get('boundingBox'), |
951 | + '.close .close-button', |
952 | + 'keydown', { keyCode: ESCAPE }); |
953 | + }, |
954 | + |
955 | test_picker_can_be_instantiated: function() { |
956 | this.overlay = new Y.lazr.PrettyOverlay(); |
957 | Assert.isInstanceOf( |
958 | @@ -146,9 +152,7 @@ |
959 | this.overlay = new Y.lazr.PrettyOverlay(); |
960 | this.overlay.render(); |
961 | |
962 | - simulate(this.overlay.get('boundingBox'), |
963 | - '.close .close-button', |
964 | - 'keypress', { keyCode: ESCAPE }); |
965 | + this.hitEscape(); |
966 | Assert.isFalse(this.overlay.get('visible'), "The widget wasn't hidden"); |
967 | }, |
968 | |
969 | @@ -162,9 +166,7 @@ |
970 | event_was_fired = true; |
971 | }); |
972 | }, this); |
973 | - simulate(this.overlay.get('boundingBox'), |
974 | - '.close .close-button', |
975 | - 'click', { keyCode: ESCAPE }); |
976 | + this.hitEscape(); |
977 | this.wait(function() { |
978 | Assert.isTrue(event_was_fired, "cancel event wasn't fired"); |
979 | }, 3000); |
980 | @@ -177,15 +179,11 @@ |
981 | this.overlay = new Y.lazr.PrettyOverlay(); |
982 | this.overlay.render(); |
983 | |
984 | - simulate(this.overlay.get('boundingBox'), |
985 | - '.close .close-button', |
986 | - 'keypress', { keyCode: ESCAPE }); |
987 | + this.hitEscape(); |
988 | Assert.isFalse(this.overlay.get('visible'), "The widget wasn't hidden"); |
989 | this.overlay.show(); |
990 | Assert.isTrue(this.overlay.get('visible'), "The widget wasn't shown again"); |
991 | - simulate(this.overlay.get('boundingBox'), |
992 | - '.close .close-button', |
993 | - 'keypress', { keyCode: ESCAPE }); |
994 | + this.hitEscape(); |
995 | Assert.isFalse(this.overlay.get('visible'), "The widget wasn't hidden"); |
996 | }, |
997 | |
998 | @@ -193,7 +191,7 @@ |
999 | this.overlay = new Y.lazr.PrettyOverlay(); |
1000 | function PrettyOverlaySubclass(config) { |
1001 | PrettyOverlaySubclass.superclass.constructor.apply(this, arguments); |
1002 | - }; |
1003 | + } |
1004 | PrettyOverlaySubclass.NAME = 'lazr-overlaysubclass'; |
1005 | Y.extend(PrettyOverlaySubclass, Y.lazr.PrettyOverlay); |
1006 | |
1007 | @@ -206,14 +204,13 @@ |
1008 | test_overlay_bodyContent_has_size_1: function() { |
1009 | var overlay = new Y.Overlay({ |
1010 | headerContent: 'Form for testing', |
1011 | - bodyContent: '<input type="text" name="field1" />', |
1012 | + bodyContent: '<input type="text" name="field1" />' |
1013 | }); |
1014 | overlay.render(); |
1015 | Assert.areEqual( |
1016 | 1, |
1017 | overlay.get("bodyContent").size(), |
1018 | - "The bodContent should contain only one node." |
1019 | - ) |
1020 | + "The bodContent should contain only one node."); |
1021 | }, |
1022 | |
1023 | test_set_progress: function() { |
1024 | @@ -226,7 +223,7 @@ |
1025 | Assert.areEqual( |
1026 | '23%', |
1027 | this.overlay.get('boundingBox').query('.steps .step-on').getStyle('width') |
1028 | - ) |
1029 | + ); |
1030 | } |
1031 | |
1032 | })); |
1033 | |
1034 | === modified file 'src-js/lazrjs/picker/picker.js' |
1035 | --- src-js/lazrjs/picker/picker.js 2009-10-22 19:27:45 +0000 |
1036 | +++ src-js/lazrjs/picker/picker.js 2009-11-13 15:43:10 +0000 |
1037 | @@ -166,6 +166,20 @@ |
1038 | * @preventable _defaultSave |
1039 | */ |
1040 | this.publish(SAVE, { defaultFn: this._defaultSave } ); |
1041 | + |
1042 | + // Subscribe to the cancel event so that we can clear the widget when |
1043 | + // requested. |
1044 | + this.subscribe('cancel', this._defaultCancel); |
1045 | + |
1046 | + if ( this.get('picker_activator') ) { |
1047 | + var element = Y.one(this.get('picker_activator')); |
1048 | + element.on('click', function(e) { |
1049 | + e.halt(); |
1050 | + this.show(); |
1051 | + }, this); |
1052 | + element.addClass(this.get('picker_activator_css_class')); |
1053 | + } |
1054 | + |
1055 | }, |
1056 | |
1057 | /** |
1058 | @@ -499,7 +513,7 @@ |
1059 | // is changed, and reset the selected one to the first one. |
1060 | this.after('batchesChange', function (e) { |
1061 | this._syncBatchesUI(); |
1062 | - if (this.get(SELECTED_BATCH) == 0){ |
1063 | + if (this.get(SELECTED_BATCH) === 0){ |
1064 | // If the attribute is already set to the same value, |
1065 | // the 'after' events won't be triggered, so we have |
1066 | // to trigger it manually. |
1067 | @@ -550,6 +564,21 @@ |
1068 | this._search_input.focus(); |
1069 | }, |
1070 | |
1071 | + /* |
1072 | + * Clear all elements of the picker, resetting it to its original state. |
1073 | + * |
1074 | + * @method _clear |
1075 | + * @param e {Object} The event object. |
1076 | + * @protected |
1077 | + */ |
1078 | + _clear: function() { |
1079 | + this._search_input.set('value', ''); |
1080 | + this.set('error', ''); |
1081 | + this.set('results', [{}]); |
1082 | + this._results_box.set('innerHTML', ''); |
1083 | + this.set('batches', []); |
1084 | + }, |
1085 | + |
1086 | /** |
1087 | * Handle clicks on the 'Search' button or entering the enter key in the |
1088 | * search field. This fires the search event. |
1089 | @@ -585,8 +614,25 @@ |
1090 | }, |
1091 | |
1092 | /** |
1093 | - * By default, the save event simply hides the widget. The search entered |
1094 | - * by the user is passed in the first details attribute of the event. |
1095 | + * By default, the cancel event just hides the widget, but you can |
1096 | + * have it also cleared by setting clear_on_cancel to 'true'. |
1097 | + * |
1098 | + * @method _defaultCancel |
1099 | + * @param e {Event.Facade} An Event Facade object. |
1100 | + * @protected |
1101 | + */ |
1102 | + _defaultCancel : function(e) { |
1103 | + Picker.superclass._defaultCancel.apply(this, arguments); |
1104 | + if ( this.get('clear_on_cancel') ) { |
1105 | + this._clear(); |
1106 | + } |
1107 | + }, |
1108 | + |
1109 | + /** |
1110 | + * By default, the save event clears and hides the widget, but you can |
1111 | + * have it not cleared by setting clear_on_save to 'false'. The search |
1112 | + * entered by the user is passed in the first details attribute of the |
1113 | + * event. |
1114 | * |
1115 | * @method _defaultSave |
1116 | * @param e {Event.Facade} An Event Facade object. |
1117 | @@ -594,6 +640,9 @@ |
1118 | */ |
1119 | _defaultSave : function(e) { |
1120 | this.hide(); |
1121 | + if ( this.get('clear_on_save') ) { |
1122 | + this._clear(); |
1123 | + } |
1124 | }, |
1125 | |
1126 | /** |
1127 | @@ -637,6 +686,42 @@ |
1128 | |
1129 | Picker.ATTRS = { |
1130 | /** |
1131 | + * Whether or not the search box and result list should be cleared when |
1132 | + * the save event is fired. |
1133 | + * |
1134 | + * @attribute clear_on_save |
1135 | + * @type Boolean |
1136 | + */ |
1137 | + clear_on_save: { value: true }, |
1138 | + |
1139 | + /** |
1140 | + * Whether or not the search box and result list should be cleared when |
1141 | + * the cancel event is fired. |
1142 | + * |
1143 | + * @attribute clear_on_cancel |
1144 | + * @type Boolean |
1145 | + */ |
1146 | + clear_on_cancel: { value: false }, |
1147 | + |
1148 | + /** |
1149 | + * A CSS selector for the DOM element that will activate (show) the picker |
1150 | + * once clicked. |
1151 | + * |
1152 | + * @attribute picker_activator |
1153 | + * @type String |
1154 | + */ |
1155 | + picker_activator: { value: null }, |
1156 | + |
1157 | + /** |
1158 | + * An extra CSS class to be added to the picker_activator, generally used |
1159 | + * to distinguish regular links from js-triggering ones. |
1160 | + * |
1161 | + * @attribute picker_activator_css_class |
1162 | + * @type String |
1163 | + */ |
1164 | + picker_activator_css_class: { value: 'js-action' }, |
1165 | + |
1166 | + /** |
1167 | * Minimum number of characters that need to be entered in the search |
1168 | * string input before a search event will be fired. The search string |
1169 | * will be trimmed before testing the length. |
1170 | |
1171 | === modified file 'src-js/lazrjs/picker/tests/picker.js' |
1172 | --- src-js/lazrjs/picker/tests/picker.js 2009-10-21 21:43:07 +0000 |
1173 | +++ src-js/lazrjs/picker/tests/picker.js 2009-11-13 15:43:10 +0000 |
1174 | @@ -206,7 +206,7 @@ |
1175 | [false, true, false, true], results.hasClass(Y.lazr.ui.CSS_ODD)); |
1176 | }, |
1177 | |
1178 | - test_clicking_search_button_fires_save_event: function () { |
1179 | + test_clicking_search_button_fires_search_event: function () { |
1180 | this.picker.render(); |
1181 | |
1182 | var bb = this.picker.get('boundingBox'); |
1183 | @@ -379,6 +379,14 @@ |
1184 | }, 3000); |
1185 | }, |
1186 | |
1187 | + test_cancel_event_hides_widget: function () { |
1188 | + this.picker.render(); |
1189 | + |
1190 | + this.picker.fire('cancel', 'bogus'); |
1191 | + Assert.isFalse( |
1192 | + this.picker.get('visible'), "The widget should be hidden."); |
1193 | + }, |
1194 | + |
1195 | test_save_event_hides_widget: function () { |
1196 | this.picker.render(); |
1197 | |
1198 | @@ -387,6 +395,48 @@ |
1199 | this.picker.get('visible'), "The widget should be hidden."); |
1200 | }, |
1201 | |
1202 | + test_save_event_clears_widget_by_default: function () { |
1203 | + this.picker.render(); |
1204 | + |
1205 | + this.picker._search_input.set('value', 'foo'); |
1206 | + this.picker.fire('save', 'bogus'); |
1207 | + Assert.areEqual( |
1208 | + '', this.picker._search_input.get('value'), |
1209 | + "The widget hasn't been cleared"); |
1210 | + }, |
1211 | + |
1212 | + test_save_does_not_clear_widget_when_clear_on_save_is_false: function () { |
1213 | + picker = new Y.Picker({clear_on_save: false}); |
1214 | + picker.render(); |
1215 | + |
1216 | + picker._search_input.set('value', 'foo'); |
1217 | + picker.fire('save', 'bogus'); |
1218 | + Assert.areEqual( |
1219 | + 'foo', picker._search_input.get('value'), |
1220 | + "The widget has been cleared but it should not"); |
1221 | + }, |
1222 | + |
1223 | + test_cancel_event_does_not_clear_widget_by_default: function () { |
1224 | + this.picker.render(); |
1225 | + |
1226 | + this.picker._search_input.set('value', 'foo'); |
1227 | + this.picker.fire('cancel', 'bogus'); |
1228 | + Assert.areEqual( |
1229 | + 'foo', this.picker._search_input.get('value'), |
1230 | + "The widget has been cleared but it should not"); |
1231 | + }, |
1232 | + |
1233 | + test_cancel_event_clears_widget_when_clear_on_cancel_is_true: function () { |
1234 | + picker = new Y.Picker({clear_on_cancel: true}); |
1235 | + picker.render(); |
1236 | + |
1237 | + picker._search_input.set('value', 'foo'); |
1238 | + picker.fire('cancel', 'bogus'); |
1239 | + Assert.areEqual( |
1240 | + '', picker._search_input.get('value'), |
1241 | + "The widget hasn't been cleared"); |
1242 | + }, |
1243 | + |
1244 | test_search_clears_any_eror: function () { |
1245 | this.picker.render(); |
1246 | this.picker.set('error', "An error"); |
1247 | |
1248 | === removed directory 'src-js/lazrjs/yui/3.0.0pr2' |
1249 | === removed directory 'src-js/lazrjs/yui/3.0.0pr2/build' |
1250 | === removed directory 'src-js/lazrjs/yui/3.0.0pr2/build/anim' |
1251 | === removed file 'src-js/lazrjs/yui/3.0.0pr2/build/anim/README' |
1252 | --- src-js/lazrjs/yui/3.0.0pr2/build/anim/README 2008-12-15 13:29:08 +0000 |
1253 | +++ src-js/lazrjs/yui/3.0.0pr2/build/anim/README 1970-01-01 00:00:00 +0000 |
1254 | @@ -1,8 +0,0 @@ |
1255 | -**** version 3.0.0 PR2 *** |
1256 | - |
1257 | -* easing attribute now accepts string ("easeOut" resolves to Y.Easing.easeOut) |
1258 | - |
1259 | - |
1260 | -**** version 3.0.0 PR1 *** |
1261 | - |
1262 | -* initial 3.0 revision |
1263 | |
1264 | === removed file 'src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-base-debug.js' |
1265 | --- src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-base-debug.js 2008-12-15 13:29:08 +0000 |
1266 | +++ src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-base-debug.js 1970-01-01 00:00:00 +0000 |
1267 | @@ -1,593 +0,0 @@ |
1268 | -/* |
1269 | -Copyright (c) 2008, Yahoo! Inc. All rights reserved. |
1270 | -Code licensed under the BSD License: |
1271 | -http://developer.yahoo.net/yui/license.txt |
1272 | -version: 3.0.0pr2 |
1273 | -*/ |
1274 | -YUI.add('anim-base', function(Y) { |
1275 | - |
1276 | -/** |
1277 | - * Y.Animation Utility. |
1278 | - * @module anim |
1279 | - */ |
1280 | - |
1281 | - /** |
1282 | - * Handles animation _queueing and threading. |
1283 | - * @class Anim |
1284 | - * @constructor |
1285 | - * @extends Base |
1286 | - */ |
1287 | - |
1288 | - var RUNNING = 'running', |
1289 | - START_TIME = 'startTime', |
1290 | - ELAPSED_TIME = 'elapsedTime', |
1291 | - /** |
1292 | - * @event start |
1293 | - * @description fires when an animation begins. |
1294 | - * @param {Event} ev The start event. |
1295 | - * @type Event.Custom |
1296 | - */ |
1297 | - START = 'start', |
1298 | - |
1299 | - /** |
1300 | - * @event tween |
1301 | - * @description fires every frame of the animation. |
1302 | - * @param {Event} ev The tween event. |
1303 | - * @type Event.Custom |
1304 | - */ |
1305 | - TWEEN = 'tween', |
1306 | - |
1307 | - /** |
1308 | - * @event end |
1309 | - * @description fires after the animation completes. |
1310 | - * @param {Event} ev The end event. |
1311 | - * @type Event.Custom |
1312 | - */ |
1313 | - END = 'end', |
1314 | - NODE = 'node', |
1315 | - PAUSED = 'paused', |
1316 | - REVERSE = 'reverse', // TODO: cleanup |
1317 | - ITERATION_COUNT = 'iterationCount', |
1318 | - |
1319 | - NUM = Number; |
1320 | - |
1321 | - var _running = {}, |
1322 | - _instances = {}, |
1323 | - _timer; |
1324 | - |
1325 | - Y.Anim = function() { |
1326 | - Y.Anim.superclass.constructor.apply(this, arguments); |
1327 | - _instances[Y.stamp(this)] = this; |
1328 | - }; |
1329 | - |
1330 | - Y.Anim.NAME = 'anim'; |
1331 | - |
1332 | - /** |
1333 | - * Regex of properties that should use the default unit. |
1334 | - * |
1335 | - * @property RE_DEFAULT_UNIT |
1336 | - * @static |
1337 | - */ |
1338 | - Y.Anim.RE_DEFAULT_UNIT = /^width|height|top|right|bottom|left|margin.*|padding.*|border.*$/i; |
1339 | - |
1340 | - /** |
1341 | - * The default unit to use with properties that pass the RE_DEFAULT_UNIT test. |
1342 | - * |
1343 | - * @property DEFAULT_UNIT |
1344 | - * @static |
1345 | - */ |
1346 | - Y.Anim.DEFAULT_UNIT = 'px'; |
1347 | - |
1348 | - Y.Anim.DEFAULT_EASING = function (t, b, c, d) { |
1349 | - return c * t / d + b; // linear easing |
1350 | - }; |
1351 | - |
1352 | - /** |
1353 | - * Bucket for custom getters and setters |
1354 | - * |
1355 | - * @property behaviors |
1356 | - * @static |
1357 | - */ |
1358 | - Y.Anim.behaviors = { |
1359 | - left: { |
1360 | - get: function(anim, attr) { |
1361 | - return anim._getOffset(attr); |
1362 | - } |
1363 | - } |
1364 | - }; |
1365 | - |
1366 | - Y.Anim.behaviors.top = Y.Anim.behaviors.left; |
1367 | - |
1368 | - /** |
1369 | - * The default setter to use when setting object properties. |
1370 | - * |
1371 | - * @property DEFAULT_SETTER |
1372 | - * @static |
1373 | - */ |
1374 | - Y.Anim.DEFAULT_SETTER = function(anim, att, from, to, elapsed, duration, fn, unit) { |
1375 | - unit = unit || ''; |
1376 | - anim._node.setStyle(att, fn(elapsed, NUM(from), NUM(to) - NUM(from), duration) + unit); |
1377 | - }; |
1378 | - |
1379 | - /** |
1380 | - * The default getter to use when getting object properties. |
1381 | - * |
1382 | - * @property DEFAULT_GETTER |
1383 | - * @static |
1384 | - */ |
1385 | - Y.Anim.DEFAULT_GETTER = function(anim, prop) { |
1386 | - return anim._node.getComputedStyle(prop); |
1387 | - }; |
1388 | - |
1389 | - Y.Anim.ATTRS = { |
1390 | - /** |
1391 | - * The object to be animated. |
1392 | - * @attribute node |
1393 | - * @type Node |
1394 | - */ |
1395 | - node: { |
1396 | - set: function(node) { |
1397 | - node = Y.Node.get(node); |
1398 | - this._node = node; |
1399 | - if (!node) { |
1400 | - Y.fail('Y.Anim: invalid node: ' + node); |
1401 | - } |
1402 | - return node; |
1403 | - } |
1404 | - }, |
1405 | - |
1406 | - /** |
1407 | - * The length of the animation. Defaults to "1" (second). |
1408 | - * @attribute duration |
1409 | - * @type NUM |
1410 | - */ |
1411 | - duration: { |
1412 | - value: 1 |
1413 | - }, |
1414 | - |
1415 | - /** |
1416 | - * The method that will provide values to the attribute(s) during the animation. |
1417 | - * Defaults to "Easing.easeNone". |
1418 | - * @attribute easing |
1419 | - * @type Function |
1420 | - */ |
1421 | - easing: { |
1422 | - value: Y.Anim.DEFAULT_EASING, |
1423 | - |
1424 | - set: function(val) { |
1425 | - if (typeof val === 'string' && Y.Easing) { |
1426 | - return Y.Easing[val]; |
1427 | - } |
1428 | - } |
1429 | - }, |
1430 | - |
1431 | - /** |
1432 | - * The starting values for the animated properties. |
1433 | - * Fields may be strings, numbers, or functions. |
1434 | - * If a function is used, the return value becomes the from value. |
1435 | - * If no from value is specified, the DEFAULT_GETTER will be used. |
1436 | - * @attribute from |
1437 | - * @type Object |
1438 | - */ |
1439 | - from: {}, |
1440 | - |
1441 | - /** |
1442 | - * The ending values for the animated properties. |
1443 | - * Fields may be strings, numbers, or functions. |
1444 | - * @attribute to |
1445 | - * @type Object |
1446 | - */ |
1447 | - to: {}, |
1448 | - |
1449 | - /** |
1450 | - * Date stamp for the first frame of the animation. |
1451 | - * @attribute startTime |
1452 | - * @type Int |
1453 | - * @default 0 |
1454 | - * @readOnly |
1455 | - */ |
1456 | - startTime: { |
1457 | - value: 0, |
1458 | - readOnly: true |
1459 | - }, |
1460 | - |
1461 | - /** |
1462 | - * Current time the animation has been running. |
1463 | - * @attribute elapsedTime |
1464 | - * @type Int |
1465 | - * @default 0 |
1466 | - * @readOnly |
1467 | - */ |
1468 | - elapsedTime: { |
1469 | - value: 0, |
1470 | - readOnly: true |
1471 | - }, |
1472 | - |
1473 | - /** |
1474 | - * Whether or not the animation is currently running. |
1475 | - * @attribute running |
1476 | - * @type Boolean |
1477 | - * @default false |
1478 | - * @readOnly |
1479 | - */ |
1480 | - running: { |
1481 | - get: function() { |
1482 | - return !!_running[Y.stamp(this)]; |
1483 | - }, |
1484 | - value: false, |
1485 | - readOnly: true |
1486 | - }, |
1487 | - |
1488 | - /** |
1489 | - * The number of times the animation should run |
1490 | - * @attribute iterations |
1491 | - * @type Int |
1492 | - * @default 1 |
1493 | - */ |
1494 | - iterations: { |
1495 | - value: 1 |
1496 | - }, |
1497 | - |
1498 | - /** |
1499 | - * The number of iterations that have occurred. |
1500 | - * Resets when an animation ends (reaches iteration count or stop() called). |
1501 | - * @attribute iterationCount |
1502 | - * @type Int |
1503 | - * @default 0 |
1504 | - * @readOnly |
1505 | - */ |
1506 | - iterationCount: { |
1507 | - value: 0, |
1508 | - readOnly: true |
1509 | - }, |
1510 | - |
1511 | - /** |
1512 | - * How iterations of the animation should behave. |
1513 | - * Possible values are "normal" and "alternate". |
1514 | - * Normal will repeat the animation, alternate will reverse on every other pass. |
1515 | - * |
1516 | - * @attribute direction |
1517 | - * @type String |
1518 | - * @default "normal" |
1519 | - */ |
1520 | - direction: { |
1521 | - value: 'normal' // | alternate (fwd on odd, rev on even per spec) |
1522 | - }, |
1523 | - |
1524 | - /** |
1525 | - * Whether or not the animation is currently paused. |
1526 | - * @attribute running |
1527 | - * @type Boolean |
1528 | - * @default false |
1529 | - * @readOnly |
1530 | - */ |
1531 | - paused: { |
1532 | - readOnly: true, |
1533 | - value: false |
1534 | - }, |
1535 | - |
1536 | - /** |
1537 | - * If true, animation begins from last frame |
1538 | - * @attribute reverse |
1539 | - * @type Boolean |
1540 | - * @default false |
1541 | - */ |
1542 | - reverse: { |
1543 | - value: false |
1544 | - } |
1545 | - |
1546 | - |
1547 | - }; |
1548 | - |
1549 | - /** |
1550 | - * Runs all animation instances. |
1551 | - * @method run |
1552 | - * @static |
1553 | - */ |
1554 | - Y.Anim.run = function() { |
1555 | - for (var i in _instances) { |
1556 | - if (_instances[i].run) { |
1557 | - _instances[i].run(); |
1558 | - } |
1559 | - } |
1560 | - }; |
1561 | - |
1562 | - /** |
1563 | - * Pauses all animation instances. |
1564 | - * @method pause |
1565 | - * @static |
1566 | - */ |
1567 | - Y.Anim.pause = function() { |
1568 | - for (var i in _running) { // stop timer if nothing running |
1569 | - if (_running[i].pause) { |
1570 | - _running[i].pause(); |
1571 | - } |
1572 | - } |
1573 | - Y.Anim._stopTimer(); |
1574 | - }; |
1575 | - |
1576 | - /** |
1577 | - * Stops all animation instances. |
1578 | - * @method stop |
1579 | - * @static |
1580 | - */ |
1581 | - Y.Anim.stop = function() { |
1582 | - for (var i in _running) { // stop timer if nothing running |
1583 | - if (_running[i].stop) { |
1584 | - _running[i].stop(); |
1585 | - } |
1586 | - } |
1587 | - Y.Anim._stopTimer(); |
1588 | - }; |
1589 | - |
1590 | - Y.Anim._startTimer = function() { |
1591 | - if (!_timer) { |
1592 | - _timer = setInterval(Y.Anim._runFrame, 1); |
1593 | - } |
1594 | - }; |
1595 | - |
1596 | - Y.Anim._stopTimer = function() { |
1597 | - clearInterval(_timer); |
1598 | - _timer = 0; |
1599 | - }; |
1600 | - |
1601 | - /** |
1602 | - * Called per Interval to handle each animation frame. |
1603 | - * @method _runFrame |
1604 | - * @private |
1605 | - * @static |
1606 | - */ |
1607 | - Y.Anim._runFrame = function() { |
1608 | - var done = true; |
1609 | - for (var anim in _running) { |
1610 | - if (_running[anim]._runFrame) { |
1611 | - done = false; |
1612 | - _running[anim]._runFrame(); |
1613 | - } |
1614 | - } |
1615 | - |
1616 | - if (done) { |
1617 | - Y.Anim._stopTimer(); |
1618 | - } |
1619 | - }; |
1620 | - |
1621 | - Y.Anim.RE_UNITS = /^(-?\d*\.?\d*){1}(em|ex|px|in|cm|mm|pt|pc|%)*$/; |
1622 | - |
1623 | - var proto = { |
1624 | - /** |
1625 | - * Starts or resumes an animation. |
1626 | - * percent start time marker. |
1627 | - * @method run |
1628 | - * @chainable |
1629 | - */ |
1630 | - run: function() { |
1631 | - if (!this.get(RUNNING)) { |
1632 | - this._start(); |
1633 | - } else if (this.get(PAUSED)) { |
1634 | - this._resume(); |
1635 | - } |
1636 | - return this; |
1637 | - }, |
1638 | - |
1639 | - /** |
1640 | - * Pauses the animation and |
1641 | - * freezes it in its current state and time. |
1642 | - * Calling run() will continue where it left off. |
1643 | - * @method pause |
1644 | - * @chainable |
1645 | - */ |
1646 | - pause: function() { |
1647 | - if (this.get(RUNNING)) { |
1648 | - this._pause(); |
1649 | - } |
1650 | - return this; |
1651 | - }, |
1652 | - |
1653 | - /** |
1654 | - * Stops the animation and resets its time. |
1655 | - * @method stop |
1656 | - * @chainable |
1657 | - */ |
1658 | - stop: function(finish) { |
1659 | - if (this.get(RUNNING) || this.get(PAUSED)) { |
1660 | - this._end(finish); |
1661 | - } |
1662 | - return this; |
1663 | - }, |
1664 | - |
1665 | - _added: false, |
1666 | - |
1667 | - _start: function() { |
1668 | - this._set(START_TIME, new Date() - this.get(ELAPSED_TIME)); |
1669 | - this._actualFrames = 0; |
1670 | - if (!this.get(PAUSED)) { |
1671 | - this._initAttr(); |
1672 | - } |
1673 | - _running[Y.stamp(this)] = this; |
1674 | - Y.Anim._startTimer(); |
1675 | - |
1676 | - this.fire(START); |
1677 | - }, |
1678 | - |
1679 | - _pause: function() { |
1680 | - this._set(START_TIME, null); |
1681 | - this._set(PAUSED, true); |
1682 | - delete _running[Y.stamp(this)]; |
1683 | - |
1684 | - /** |
1685 | - * @event pause |
1686 | - * @description fires when an animation is paused. |
1687 | - * @param {Event} ev The pause event. |
1688 | - * @type Event.Custom |
1689 | - */ |
1690 | - this.fire('pause'); |
1691 | - }, |
1692 | - |
1693 | - _resume: function() { |
1694 | - this._set(PAUSED, false); |
1695 | - _running[Y.stamp(this)] = this; |
1696 | - |
1697 | - /** |
1698 | - * @event resume |
1699 | - * @description fires when an animation is resumed (run from pause). |
1700 | - * @param {Event} ev The pause event. |
1701 | - * @type Event.Custom |
1702 | - */ |
1703 | - this.fire('resume'); |
1704 | - }, |
1705 | - |
1706 | - _end: function(finish) { |
1707 | - this._set(START_TIME, null); |
1708 | - this._set(ELAPSED_TIME, 0); |
1709 | - this._set(PAUSED, false); |
1710 | - |
1711 | - delete _running[Y.stamp(this)]; |
1712 | - this.fire(END, {elapsed: this.get(ELAPSED_TIME)}); |
1713 | - }, |
1714 | - |
1715 | - _runFrame: function() { |
1716 | - var attr = this._runtimeAttr, |
1717 | - customAttr = Y.Anim.behaviors, |
1718 | - easing = attr.easing, |
1719 | - d = attr.duration, |
1720 | - t = new Date() - this.get(START_TIME), |
1721 | - reversed = this.get(REVERSE), |
1722 | - done = (t >= d), |
1723 | - lastFrame = d, |
1724 | - attribute, |
1725 | - setter; |
1726 | - |
1727 | - if (reversed) { |
1728 | - t = d - t; |
1729 | - done = (t <= 0); |
1730 | - lastFrame = 0; |
1731 | - } |
1732 | - |
1733 | - for (var i in attr) { |
1734 | - if (attr[i].to) { |
1735 | - attribute = attr[i]; |
1736 | - setter = (i in customAttr && 'set' in customAttr[i]) ? |
1737 | - customAttr[i].set : Y.Anim.DEFAULT_SETTER; |
1738 | - |
1739 | - if (!done) { |
1740 | - setter(this, i, attribute.from, attribute.to, t, d, easing, attribute.unit); |
1741 | - } else { // ensure final frame value is set |
1742 | - // TODO: handle keyframes |
1743 | - setter(this, i, attribute.from, attribute.to, lastFrame, d, easing, attribute.unit); |
1744 | - } |
1745 | - } |
1746 | - } |
1747 | - |
1748 | - this._actualFrames += 1; |
1749 | - this._set(ELAPSED_TIME, t); |
1750 | - |
1751 | - this.fire(TWEEN); |
1752 | - if (done) { |
1753 | - this._lastFrame(); |
1754 | - } |
1755 | - }, |
1756 | - |
1757 | - _lastFrame: function() { |
1758 | - var iter = this.get('iterations'), |
1759 | - iterCount = this.get(ITERATION_COUNT); |
1760 | - |
1761 | - iterCount += 1; |
1762 | - if (iter === 'infinite' || iterCount < iter) { |
1763 | - if (this.get('direction') === 'alternate') { |
1764 | - this.set(REVERSE, !this.get(REVERSE)); // flip it |
1765 | - } |
1766 | - /** |
1767 | - * @event iteration |
1768 | - * @description fires when an animation begins an iteration. |
1769 | - * @param {Event} ev The iteration event. |
1770 | - * @type Event.Custom |
1771 | - */ |
1772 | - this.fire('iteration'); |
1773 | - } else { |
1774 | - iterCount = 0; |
1775 | - this._end(); |
1776 | - } |
1777 | - |
1778 | - this._set(START_TIME, new Date()); |
1779 | - this._set(ITERATION_COUNT, iterCount); |
1780 | - }, |
1781 | - |
1782 | - _initAttr: function() { |
1783 | - var from = this.get('from') || {}, |
1784 | - to = this.get('to') || {}, |
1785 | - dur = this.get('duration') * 1000, |
1786 | - node = this.get(NODE), |
1787 | - easing = this.get('easing') || {}, |
1788 | - attr = {}, |
1789 | - customAttr = Y.Anim.behaviors, |
1790 | - unit, begin, end; |
1791 | - |
1792 | - Y.each(to, function(val, name) { |
1793 | - if (typeof val === 'function') { |
1794 | - val = val.call(this, node); |
1795 | - } |
1796 | - |
1797 | - begin = from[name]; |
1798 | - if (begin === undefined) { |
1799 | - begin = (name in customAttr && 'get' in customAttr[name]) ? |
1800 | - customAttr[name].get(this, name) : Y.Anim.DEFAULT_GETTER(this, name); |
1801 | - } else if (typeof begin === 'function') { |
1802 | - begin = begin.call(this, node); |
1803 | - } |
1804 | - |
1805 | - var mFrom = Y.Anim.RE_UNITS.exec(begin); |
1806 | - var mTo = Y.Anim.RE_UNITS.exec(val); |
1807 | - |
1808 | - begin = mFrom ? mFrom[1] : begin; |
1809 | - var end = mTo ? mTo[1] : val, |
1810 | - unit = mTo ? mTo[2] : mFrom ? mFrom[2] : ''; // one might be zero TODO: mixed units |
1811 | - |
1812 | - if (!unit && Y.Anim.RE_DEFAULT_UNIT.test(name)) { |
1813 | - unit = Y.Anim.DEFAULT_UNIT; |
1814 | - } |
1815 | - |
1816 | - if (!begin || !end) { |
1817 | - Y.fail('invalid "from" or "to" for "' + name + '"', 'Anim'); |
1818 | - return; |
1819 | - } |
1820 | - |
1821 | - attr[name] = { |
1822 | - from: begin, |
1823 | - to: end, |
1824 | - unit: unit |
1825 | - }; |
1826 | - |
1827 | - attr.duration = dur; |
1828 | - attr.easing = easing; |
1829 | - |
1830 | - }, this); |
1831 | - |
1832 | - this._runtimeAttr = attr; |
1833 | - }, |
1834 | - |
1835 | - |
1836 | - // TODO: move to computedStyle? (browsers dont agree on default computed offsets) |
1837 | - _getOffset: function(attr) { |
1838 | - var node = this._node, |
1839 | - val = node.getComputedStyle(attr), |
1840 | - get = (attr === 'left') ? 'getX': 'getY', |
1841 | - set = (attr === 'left') ? 'setX': 'setY'; |
1842 | - |
1843 | - if (val === 'auto') { |
1844 | - var position = node.getStyle('position'); |
1845 | - if (position === 'absolute' || position === 'fixed') { |
1846 | - val = node[get](); |
1847 | - node[set](val); |
1848 | - } else { |
1849 | - val = 0; |
1850 | - } |
1851 | - } |
1852 | - |
1853 | - return val; |
1854 | - } |
1855 | - }; |
1856 | - |
1857 | - Y.extend(Y.Anim, Y.Base, proto); |
1858 | - |
1859 | - |
1860 | -}, '3.0.0pr2' ,{requires:['base', 'node']}); |
1861 | |
1862 | === removed file 'src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-base-min.js' |
1863 | --- src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-base-min.js 2008-12-15 13:29:08 +0000 |
1864 | +++ src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-base-min.js 1970-01-01 00:00:00 +0000 |
1865 | @@ -1,7 +0,0 @@ |
1866 | -/* |
1867 | -Copyright (c) 2008, Yahoo! Inc. All rights reserved. |
1868 | -Code licensed under the BSD License: |
1869 | -http://developer.yahoo.net/yui/license.txt |
1870 | -version: 3.0.0pr2 |
1871 | -*/ |
1872 | -YUI.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"]}); |
1873 | \ No newline at end of file |
1874 | |
1875 | === removed file 'src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-base.js' |
1876 | --- src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-base.js 2008-12-15 13:29:08 +0000 |
1877 | +++ src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-base.js 1970-01-01 00:00:00 +0000 |
1878 | @@ -1,593 +0,0 @@ |
1879 | -/* |
1880 | -Copyright (c) 2008, Yahoo! Inc. All rights reserved. |
1881 | -Code licensed under the BSD License: |
1882 | -http://developer.yahoo.net/yui/license.txt |
1883 | -version: 3.0.0pr2 |
1884 | -*/ |
1885 | -YUI.add('anim-base', function(Y) { |
1886 | - |
1887 | -/** |
1888 | - * Y.Animation Utility. |
1889 | - * @module anim |
1890 | - */ |
1891 | - |
1892 | - /** |
1893 | - * Handles animation _queueing and threading. |
1894 | - * @class Anim |
1895 | - * @constructor |
1896 | - * @extends Base |
1897 | - */ |
1898 | - |
1899 | - var RUNNING = 'running', |
1900 | - START_TIME = 'startTime', |
1901 | - ELAPSED_TIME = 'elapsedTime', |
1902 | - /** |
1903 | - * @event start |
1904 | - * @description fires when an animation begins. |
1905 | - * @param {Event} ev The start event. |
1906 | - * @type Event.Custom |
1907 | - */ |
1908 | - START = 'start', |
1909 | - |
1910 | - /** |
1911 | - * @event tween |
1912 | - * @description fires every frame of the animation. |
1913 | - * @param {Event} ev The tween event. |
1914 | - * @type Event.Custom |
1915 | - */ |
1916 | - TWEEN = 'tween', |
1917 | - |
1918 | - /** |
1919 | - * @event end |
1920 | - * @description fires after the animation completes. |
1921 | - * @param {Event} ev The end event. |
1922 | - * @type Event.Custom |
1923 | - */ |
1924 | - END = 'end', |
1925 | - NODE = 'node', |
1926 | - PAUSED = 'paused', |
1927 | - REVERSE = 'reverse', // TODO: cleanup |
1928 | - ITERATION_COUNT = 'iterationCount', |
1929 | - |
1930 | - NUM = Number; |
1931 | - |
1932 | - var _running = {}, |
1933 | - _instances = {}, |
1934 | - _timer; |
1935 | - |
1936 | - Y.Anim = function() { |
1937 | - Y.Anim.superclass.constructor.apply(this, arguments); |
1938 | - _instances[Y.stamp(this)] = this; |
1939 | - }; |
1940 | - |
1941 | - Y.Anim.NAME = 'anim'; |
1942 | - |
1943 | - /** |
1944 | - * Regex of properties that should use the default unit. |
1945 | - * |
1946 | - * @property RE_DEFAULT_UNIT |
1947 | - * @static |
1948 | - */ |
1949 | - Y.Anim.RE_DEFAULT_UNIT = /^width|height|top|right|bottom|left|margin.*|padding.*|border.*$/i; |
1950 | - |
1951 | - /** |
1952 | - * The default unit to use with properties that pass the RE_DEFAULT_UNIT test. |
1953 | - * |
1954 | - * @property DEFAULT_UNIT |
1955 | - * @static |
1956 | - */ |
1957 | - Y.Anim.DEFAULT_UNIT = 'px'; |
1958 | - |
1959 | - Y.Anim.DEFAULT_EASING = function (t, b, c, d) { |
1960 | - return c * t / d + b; // linear easing |
1961 | - }; |
1962 | - |
1963 | - /** |
1964 | - * Bucket for custom getters and setters |
1965 | - * |
1966 | - * @property behaviors |
1967 | - * @static |
1968 | - */ |
1969 | - Y.Anim.behaviors = { |
1970 | - left: { |
1971 | - get: function(anim, attr) { |
1972 | - return anim._getOffset(attr); |
1973 | - } |
1974 | - } |
1975 | - }; |
1976 | - |
1977 | - Y.Anim.behaviors.top = Y.Anim.behaviors.left; |
1978 | - |
1979 | - /** |
1980 | - * The default setter to use when setting object properties. |
1981 | - * |
1982 | - * @property DEFAULT_SETTER |
1983 | - * @static |
1984 | - */ |
1985 | - Y.Anim.DEFAULT_SETTER = function(anim, att, from, to, elapsed, duration, fn, unit) { |
1986 | - unit = unit || ''; |
1987 | - anim._node.setStyle(att, fn(elapsed, NUM(from), NUM(to) - NUM(from), duration) + unit); |
1988 | - }; |
1989 | - |
1990 | - /** |
1991 | - * The default getter to use when getting object properties. |
1992 | - * |
1993 | - * @property DEFAULT_GETTER |
1994 | - * @static |
1995 | - */ |
1996 | - Y.Anim.DEFAULT_GETTER = function(anim, prop) { |
1997 | - return anim._node.getComputedStyle(prop); |
1998 | - }; |
1999 | - |
2000 | - Y.Anim.ATTRS = { |
2001 | - /** |
2002 | - * The object to be animated. |
2003 | - * @attribute node |
2004 | - * @type Node |
2005 | - */ |
2006 | - node: { |
2007 | - set: function(node) { |
2008 | - node = Y.Node.get(node); |
2009 | - this._node = node; |
2010 | - if (!node) { |
2011 | - Y.fail('Y.Anim: invalid node: ' + node); |
2012 | - } |
2013 | - return node; |
2014 | - } |
2015 | - }, |
2016 | - |
2017 | - /** |
2018 | - * The length of the animation. Defaults to "1" (second). |
2019 | - * @attribute duration |
2020 | - * @type NUM |
2021 | - */ |
2022 | - duration: { |
2023 | - value: 1 |
2024 | - }, |
2025 | - |
2026 | - /** |
2027 | - * The method that will provide values to the attribute(s) during the animation. |
2028 | - * Defaults to "Easing.easeNone". |
2029 | - * @attribute easing |
2030 | - * @type Function |
2031 | - */ |
2032 | - easing: { |
2033 | - value: Y.Anim.DEFAULT_EASING, |
2034 | - |
2035 | - set: function(val) { |
2036 | - if (typeof val === 'string' && Y.Easing) { |
2037 | - return Y.Easing[val]; |
2038 | - } |
2039 | - } |
2040 | - }, |
2041 | - |
2042 | - /** |
2043 | - * The starting values for the animated properties. |
2044 | - * Fields may be strings, numbers, or functions. |
2045 | - * If a function is used, the return value becomes the from value. |
2046 | - * If no from value is specified, the DEFAULT_GETTER will be used. |
2047 | - * @attribute from |
2048 | - * @type Object |
2049 | - */ |
2050 | - from: {}, |
2051 | - |
2052 | - /** |
2053 | - * The ending values for the animated properties. |
2054 | - * Fields may be strings, numbers, or functions. |
2055 | - * @attribute to |
2056 | - * @type Object |
2057 | - */ |
2058 | - to: {}, |
2059 | - |
2060 | - /** |
2061 | - * Date stamp for the first frame of the animation. |
2062 | - * @attribute startTime |
2063 | - * @type Int |
2064 | - * @default 0 |
2065 | - * @readOnly |
2066 | - */ |
2067 | - startTime: { |
2068 | - value: 0, |
2069 | - readOnly: true |
2070 | - }, |
2071 | - |
2072 | - /** |
2073 | - * Current time the animation has been running. |
2074 | - * @attribute elapsedTime |
2075 | - * @type Int |
2076 | - * @default 0 |
2077 | - * @readOnly |
2078 | - */ |
2079 | - elapsedTime: { |
2080 | - value: 0, |
2081 | - readOnly: true |
2082 | - }, |
2083 | - |
2084 | - /** |
2085 | - * Whether or not the animation is currently running. |
2086 | - * @attribute running |
2087 | - * @type Boolean |
2088 | - * @default false |
2089 | - * @readOnly |
2090 | - */ |
2091 | - running: { |
2092 | - get: function() { |
2093 | - return !!_running[Y.stamp(this)]; |
2094 | - }, |
2095 | - value: false, |
2096 | - readOnly: true |
2097 | - }, |
2098 | - |
2099 | - /** |
2100 | - * The number of times the animation should run |
2101 | - * @attribute iterations |
2102 | - * @type Int |
2103 | - * @default 1 |
2104 | - */ |
2105 | - iterations: { |
2106 | - value: 1 |
2107 | - }, |
2108 | - |
2109 | - /** |
2110 | - * The number of iterations that have occurred. |
2111 | - * Resets when an animation ends (reaches iteration count or stop() called). |
2112 | - * @attribute iterationCount |
2113 | - * @type Int |
2114 | - * @default 0 |
2115 | - * @readOnly |
2116 | - */ |
2117 | - iterationCount: { |
2118 | - value: 0, |
2119 | - readOnly: true |
2120 | - }, |
2121 | - |
2122 | - /** |
2123 | - * How iterations of the animation should behave. |
2124 | - * Possible values are "normal" and "alternate". |
2125 | - * Normal will repeat the animation, alternate will reverse on every other pass. |
2126 | - * |
2127 | - * @attribute direction |
2128 | - * @type String |
2129 | - * @default "normal" |
2130 | - */ |
2131 | - direction: { |
2132 | - value: 'normal' // | alternate (fwd on odd, rev on even per spec) |
2133 | - }, |
2134 | - |
2135 | - /** |
2136 | - * Whether or not the animation is currently paused. |
2137 | - * @attribute running |
2138 | - * @type Boolean |
2139 | - * @default false |
2140 | - * @readOnly |
2141 | - */ |
2142 | - paused: { |
2143 | - readOnly: true, |
2144 | - value: false |
2145 | - }, |
2146 | - |
2147 | - /** |
2148 | - * If true, animation begins from last frame |
2149 | - * @attribute reverse |
2150 | - * @type Boolean |
2151 | - * @default false |
2152 | - */ |
2153 | - reverse: { |
2154 | - value: false |
2155 | - } |
2156 | - |
2157 | - |
2158 | - }; |
2159 | - |
2160 | - /** |
2161 | - * Runs all animation instances. |
2162 | - * @method run |
2163 | - * @static |
2164 | - */ |
2165 | - Y.Anim.run = function() { |
2166 | - for (var i in _instances) { |
2167 | - if (_instances[i].run) { |
2168 | - _instances[i].run(); |
2169 | - } |
2170 | - } |
2171 | - }; |
2172 | - |
2173 | - /** |
2174 | - * Pauses all animation instances. |
2175 | - * @method pause |
2176 | - * @static |
2177 | - */ |
2178 | - Y.Anim.pause = function() { |
2179 | - for (var i in _running) { // stop timer if nothing running |
2180 | - if (_running[i].pause) { |
2181 | - _running[i].pause(); |
2182 | - } |
2183 | - } |
2184 | - Y.Anim._stopTimer(); |
2185 | - }; |
2186 | - |
2187 | - /** |
2188 | - * Stops all animation instances. |
2189 | - * @method stop |
2190 | - * @static |
2191 | - */ |
2192 | - Y.Anim.stop = function() { |
2193 | - for (var i in _running) { // stop timer if nothing running |
2194 | - if (_running[i].stop) { |
2195 | - _running[i].stop(); |
2196 | - } |
2197 | - } |
2198 | - Y.Anim._stopTimer(); |
2199 | - }; |
2200 | - |
2201 | - Y.Anim._startTimer = function() { |
2202 | - if (!_timer) { |
2203 | - _timer = setInterval(Y.Anim._runFrame, 1); |
2204 | - } |
2205 | - }; |
2206 | - |
2207 | - Y.Anim._stopTimer = function() { |
2208 | - clearInterval(_timer); |
2209 | - _timer = 0; |
2210 | - }; |
2211 | - |
2212 | - /** |
2213 | - * Called per Interval to handle each animation frame. |
2214 | - * @method _runFrame |
2215 | - * @private |
2216 | - * @static |
2217 | - */ |
2218 | - Y.Anim._runFrame = function() { |
2219 | - var done = true; |
2220 | - for (var anim in _running) { |
2221 | - if (_running[anim]._runFrame) { |
2222 | - done = false; |
2223 | - _running[anim]._runFrame(); |
2224 | - } |
2225 | - } |
2226 | - |
2227 | - if (done) { |
2228 | - Y.Anim._stopTimer(); |
2229 | - } |
2230 | - }; |
2231 | - |
2232 | - Y.Anim.RE_UNITS = /^(-?\d*\.?\d*){1}(em|ex|px|in|cm|mm|pt|pc|%)*$/; |
2233 | - |
2234 | - var proto = { |
2235 | - /** |
2236 | - * Starts or resumes an animation. |
2237 | - * percent start time marker. |
2238 | - * @method run |
2239 | - * @chainable |
2240 | - */ |
2241 | - run: function() { |
2242 | - if (!this.get(RUNNING)) { |
2243 | - this._start(); |
2244 | - } else if (this.get(PAUSED)) { |
2245 | - this._resume(); |
2246 | - } |
2247 | - return this; |
2248 | - }, |
2249 | - |
2250 | - /** |
2251 | - * Pauses the animation and |
2252 | - * freezes it in its current state and time. |
2253 | - * Calling run() will continue where it left off. |
2254 | - * @method pause |
2255 | - * @chainable |
2256 | - */ |
2257 | - pause: function() { |
2258 | - if (this.get(RUNNING)) { |
2259 | - this._pause(); |
2260 | - } |
2261 | - return this; |
2262 | - }, |
2263 | - |
2264 | - /** |
2265 | - * Stops the animation and resets its time. |
2266 | - * @method stop |
2267 | - * @chainable |
2268 | - */ |
2269 | - stop: function(finish) { |
2270 | - if (this.get(RUNNING) || this.get(PAUSED)) { |
2271 | - this._end(finish); |
2272 | - } |
2273 | - return this; |
2274 | - }, |
2275 | - |
2276 | - _added: false, |
2277 | - |
2278 | - _start: function() { |
2279 | - this._set(START_TIME, new Date() - this.get(ELAPSED_TIME)); |
2280 | - this._actualFrames = 0; |
2281 | - if (!this.get(PAUSED)) { |
2282 | - this._initAttr(); |
2283 | - } |
2284 | - _running[Y.stamp(this)] = this; |
2285 | - Y.Anim._startTimer(); |
2286 | - |
2287 | - this.fire(START); |
2288 | - }, |
2289 | - |
2290 | - _pause: function() { |
2291 | - this._set(START_TIME, null); |
2292 | - this._set(PAUSED, true); |
2293 | - delete _running[Y.stamp(this)]; |
2294 | - |
2295 | - /** |
2296 | - * @event pause |
2297 | - * @description fires when an animation is paused. |
2298 | - * @param {Event} ev The pause event. |
2299 | - * @type Event.Custom |
2300 | - */ |
2301 | - this.fire('pause'); |
2302 | - }, |
2303 | - |
2304 | - _resume: function() { |
2305 | - this._set(PAUSED, false); |
2306 | - _running[Y.stamp(this)] = this; |
2307 | - |
2308 | - /** |
2309 | - * @event resume |
2310 | - * @description fires when an animation is resumed (run from pause). |
2311 | - * @param {Event} ev The pause event. |
2312 | - * @type Event.Custom |
2313 | - */ |
2314 | - this.fire('resume'); |
2315 | - }, |
2316 | - |
2317 | - _end: function(finish) { |
2318 | - this._set(START_TIME, null); |
2319 | - this._set(ELAPSED_TIME, 0); |
2320 | - this._set(PAUSED, false); |
2321 | - |
2322 | - delete _running[Y.stamp(this)]; |
2323 | - this.fire(END, {elapsed: this.get(ELAPSED_TIME)}); |
2324 | - }, |
2325 | - |
2326 | - _runFrame: function() { |
2327 | - var attr = this._runtimeAttr, |
2328 | - customAttr = Y.Anim.behaviors, |
2329 | - easing = attr.easing, |
2330 | - d = attr.duration, |
2331 | - t = new Date() - this.get(START_TIME), |
2332 | - reversed = this.get(REVERSE), |
2333 | - done = (t >= d), |
2334 | - lastFrame = d, |
2335 | - attribute, |
2336 | - setter; |
2337 | - |
2338 | - if (reversed) { |
2339 | - t = d - t; |
2340 | - done = (t <= 0); |
2341 | - lastFrame = 0; |
2342 | - } |
2343 | - |
2344 | - for (var i in attr) { |
2345 | - if (attr[i].to) { |
2346 | - attribute = attr[i]; |
2347 | - setter = (i in customAttr && 'set' in customAttr[i]) ? |
2348 | - customAttr[i].set : Y.Anim.DEFAULT_SETTER; |
2349 | - |
2350 | - if (!done) { |
2351 | - setter(this, i, attribute.from, attribute.to, t, d, easing, attribute.unit); |
2352 | - } else { // ensure final frame value is set |
2353 | - // TODO: handle keyframes |
2354 | - setter(this, i, attribute.from, attribute.to, lastFrame, d, easing, attribute.unit); |
2355 | - } |
2356 | - } |
2357 | - } |
2358 | - |
2359 | - this._actualFrames += 1; |
2360 | - this._set(ELAPSED_TIME, t); |
2361 | - |
2362 | - this.fire(TWEEN); |
2363 | - if (done) { |
2364 | - this._lastFrame(); |
2365 | - } |
2366 | - }, |
2367 | - |
2368 | - _lastFrame: function() { |
2369 | - var iter = this.get('iterations'), |
2370 | - iterCount = this.get(ITERATION_COUNT); |
2371 | - |
2372 | - iterCount += 1; |
2373 | - if (iter === 'infinite' || iterCount < iter) { |
2374 | - if (this.get('direction') === 'alternate') { |
2375 | - this.set(REVERSE, !this.get(REVERSE)); // flip it |
2376 | - } |
2377 | - /** |
2378 | - * @event iteration |
2379 | - * @description fires when an animation begins an iteration. |
2380 | - * @param {Event} ev The iteration event. |
2381 | - * @type Event.Custom |
2382 | - */ |
2383 | - this.fire('iteration'); |
2384 | - } else { |
2385 | - iterCount = 0; |
2386 | - this._end(); |
2387 | - } |
2388 | - |
2389 | - this._set(START_TIME, new Date()); |
2390 | - this._set(ITERATION_COUNT, iterCount); |
2391 | - }, |
2392 | - |
2393 | - _initAttr: function() { |
2394 | - var from = this.get('from') || {}, |
2395 | - to = this.get('to') || {}, |
2396 | - dur = this.get('duration') * 1000, |
2397 | - node = this.get(NODE), |
2398 | - easing = this.get('easing') || {}, |
2399 | - attr = {}, |
2400 | - customAttr = Y.Anim.behaviors, |
2401 | - unit, begin, end; |
2402 | - |
2403 | - Y.each(to, function(val, name) { |
2404 | - if (typeof val === 'function') { |
2405 | - val = val.call(this, node); |
2406 | - } |
2407 | - |
2408 | - begin = from[name]; |
2409 | - if (begin === undefined) { |
2410 | - begin = (name in customAttr && 'get' in customAttr[name]) ? |
2411 | - customAttr[name].get(this, name) : Y.Anim.DEFAULT_GETTER(this, name); |
2412 | - } else if (typeof begin === 'function') { |
2413 | - begin = begin.call(this, node); |
2414 | - } |
2415 | - |
2416 | - var mFrom = Y.Anim.RE_UNITS.exec(begin); |
2417 | - var mTo = Y.Anim.RE_UNITS.exec(val); |
2418 | - |
2419 | - begin = mFrom ? mFrom[1] : begin; |
2420 | - var end = mTo ? mTo[1] : val, |
2421 | - unit = mTo ? mTo[2] : mFrom ? mFrom[2] : ''; // one might be zero TODO: mixed units |
2422 | - |
2423 | - if (!unit && Y.Anim.RE_DEFAULT_UNIT.test(name)) { |
2424 | - unit = Y.Anim.DEFAULT_UNIT; |
2425 | - } |
2426 | - |
2427 | - if (!begin || !end) { |
2428 | - Y.fail('invalid "from" or "to" for "' + name + '"', 'Anim'); |
2429 | - return; |
2430 | - } |
2431 | - |
2432 | - attr[name] = { |
2433 | - from: begin, |
2434 | - to: end, |
2435 | - unit: unit |
2436 | - }; |
2437 | - |
2438 | - attr.duration = dur; |
2439 | - attr.easing = easing; |
2440 | - |
2441 | - }, this); |
2442 | - |
2443 | - this._runtimeAttr = attr; |
2444 | - }, |
2445 | - |
2446 | - |
2447 | - // TODO: move to computedStyle? (browsers dont agree on default computed offsets) |
2448 | - _getOffset: function(attr) { |
2449 | - var node = this._node, |
2450 | - val = node.getComputedStyle(attr), |
2451 | - get = (attr === 'left') ? 'getX': 'getY', |
2452 | - set = (attr === 'left') ? 'setX': 'setY'; |
2453 | - |
2454 | - if (val === 'auto') { |
2455 | - var position = node.getStyle('position'); |
2456 | - if (position === 'absolute' || position === 'fixed') { |
2457 | - val = node[get](); |
2458 | - node[set](val); |
2459 | - } else { |
2460 | - val = 0; |
2461 | - } |
2462 | - } |
2463 | - |
2464 | - return val; |
2465 | - } |
2466 | - }; |
2467 | - |
2468 | - Y.extend(Y.Anim, Y.Base, proto); |
2469 | - |
2470 | - |
2471 | -}, '3.0.0pr2' ,{requires:['base', 'node']}); |
2472 | |
2473 | === removed file 'src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-color-debug.js' |
2474 | --- src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-color-debug.js 2008-12-15 13:29:08 +0000 |
2475 | +++ src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-color-debug.js 1970-01-01 00:00:00 +0000 |
2476 | @@ -1,55 +0,0 @@ |
2477 | -/* |
2478 | -Copyright (c) 2008, Yahoo! Inc. All rights reserved. |
2479 | -Code licensed under the BSD License: |
2480 | -http://developer.yahoo.net/yui/license.txt |
2481 | -version: 3.0.0pr2 |
2482 | -*/ |
2483 | -YUI.add('anim-color', function(Y) { |
2484 | - |
2485 | -/** |
2486 | - * Adds support for color properties in <code>to</code> |
2487 | - * and <code>from</code> attributes. |
2488 | - * @module anim |
2489 | - * @submodule anim-color |
2490 | - * @for Anim |
2491 | - */ |
2492 | - |
2493 | -var NUM = Number; |
2494 | - |
2495 | -Y.Anim.behaviors.color = { |
2496 | - set: function(anim, att, from, to, elapsed, duration, fn) { |
2497 | - from = Y.Color.re_RGB.exec(Y.Color.toRGB(from)); |
2498 | - to = Y.Color.re_RGB.exec(Y.Color.toRGB(to)); |
2499 | - |
2500 | - if (!from || from.length < 3 || !to || to.length < 3) { |
2501 | - Y.fail('invalid from or to passed to color behavior'); |
2502 | - } |
2503 | - |
2504 | - anim._node.setStyle(att, 'rgb(' + [ |
2505 | - Math.floor(fn(elapsed, NUM(from[1]), NUM(to[1]) - NUM(from[1]), duration)), |
2506 | - Math.floor(fn(elapsed, NUM(from[2]), NUM(to[2]) - NUM(from[2]), duration)), |
2507 | - Math.floor(fn(elapsed, NUM(from[3]), NUM(to[3]) - NUM(from[3]), duration)) |
2508 | - ].join(', ') + ')'); |
2509 | - }, |
2510 | - |
2511 | - // TODO: default bgcolor const |
2512 | - get: function(anim, att) { |
2513 | - var val = anim._node.getComputedStyle(att); |
2514 | - val = (val === 'transparent') ? 'rgb(255, 255, 255)' : val; |
2515 | - return val; |
2516 | - } |
2517 | -}; |
2518 | - |
2519 | -Y.each(['backgroundColor', |
2520 | - 'borderColor', |
2521 | - 'borderTopColor', |
2522 | - 'borderRightColor', |
2523 | - 'borderBottomColor', |
2524 | - 'borderLeftColor'], |
2525 | - function(v, i) { |
2526 | - Y.Anim.behaviors[v] = Y.Anim.behaviors.color; |
2527 | - } |
2528 | -); |
2529 | - |
2530 | - |
2531 | -}, '3.0.0pr2' ,{requires:['anim-base', 'node-style']}); |
2532 | |
2533 | === removed file 'src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-color-min.js' |
2534 | --- src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-color-min.js 2008-12-15 13:29:08 +0000 |
2535 | +++ src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-color-min.js 1970-01-01 00:00:00 +0000 |
2536 | @@ -1,7 +0,0 @@ |
2537 | -/* |
2538 | -Copyright (c) 2008, Yahoo! Inc. All rights reserved. |
2539 | -Code licensed under the BSD License: |
2540 | -http://developer.yahoo.net/yui/license.txt |
2541 | -version: 3.0.0pr2 |
2542 | -*/ |
2543 | -YUI.add("anim-color",function(B){var A=Number;B.Anim.behaviors.color={set:function(F,D,I,H,C,G,E){I=B.Color.re_RGB.exec(B.Color.toRGB(I));H=B.Color.re_RGB.exec(B.Color.toRGB(H));if(!I||I.length<3||!H||H.length<3){B.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"]}); |
2544 | \ No newline at end of file |
2545 | |
2546 | === removed file 'src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-color.js' |
2547 | --- src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-color.js 2008-12-15 13:29:08 +0000 |
2548 | +++ src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-color.js 1970-01-01 00:00:00 +0000 |
2549 | @@ -1,55 +0,0 @@ |
2550 | -/* |
2551 | -Copyright (c) 2008, Yahoo! Inc. All rights reserved. |
2552 | -Code licensed under the BSD License: |
2553 | -http://developer.yahoo.net/yui/license.txt |
2554 | -version: 3.0.0pr2 |
2555 | -*/ |
2556 | -YUI.add('anim-color', function(Y) { |
2557 | - |
2558 | -/** |
2559 | - * Adds support for color properties in <code>to</code> |
2560 | - * and <code>from</code> attributes. |
2561 | - * @module anim |
2562 | - * @submodule anim-color |
2563 | - * @for Anim |
2564 | - */ |
2565 | - |
2566 | -var NUM = Number; |
2567 | - |
2568 | -Y.Anim.behaviors.color = { |
2569 | - set: function(anim, att, from, to, elapsed, duration, fn) { |
2570 | - from = Y.Color.re_RGB.exec(Y.Color.toRGB(from)); |
2571 | - to = Y.Color.re_RGB.exec(Y.Color.toRGB(to)); |
2572 | - |
2573 | - if (!from || from.length < 3 || !to || to.length < 3) { |
2574 | - Y.fail('invalid from or to passed to color behavior'); |
2575 | - } |
2576 | - |
2577 | - anim._node.setStyle(att, 'rgb(' + [ |
2578 | - Math.floor(fn(elapsed, NUM(from[1]), NUM(to[1]) - NUM(from[1]), duration)), |
2579 | - Math.floor(fn(elapsed, NUM(from[2]), NUM(to[2]) - NUM(from[2]), duration)), |
2580 | - Math.floor(fn(elapsed, NUM(from[3]), NUM(to[3]) - NUM(from[3]), duration)) |
2581 | - ].join(', ') + ')'); |
2582 | - }, |
2583 | - |
2584 | - // TODO: default bgcolor const |
2585 | - get: function(anim, att) { |
2586 | - var val = anim._node.getComputedStyle(att); |
2587 | - val = (val === 'transparent') ? 'rgb(255, 255, 255)' : val; |
2588 | - return val; |
2589 | - } |
2590 | -}; |
2591 | - |
2592 | -Y.each(['backgroundColor', |
2593 | - 'borderColor', |
2594 | - 'borderTopColor', |
2595 | - 'borderRightColor', |
2596 | - 'borderBottomColor', |
2597 | - 'borderLeftColor'], |
2598 | - function(v, i) { |
2599 | - Y.Anim.behaviors[v] = Y.Anim.behaviors.color; |
2600 | - } |
2601 | -); |
2602 | - |
2603 | - |
2604 | -}, '3.0.0pr2' ,{requires:['anim-base', 'node-style']}); |
2605 | |
2606 | === removed file 'src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-curve-debug.js' |
2607 | --- src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-curve-debug.js 2008-12-15 13:29:08 +0000 |
2608 | +++ src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-curve-debug.js 1970-01-01 00:00:00 +0000 |
2609 | @@ -1,63 +0,0 @@ |
2610 | -/* |
2611 | -Copyright (c) 2008, Yahoo! Inc. All rights reserved. |
2612 | -Code licensed under the BSD License: |
2613 | -http://developer.yahoo.net/yui/license.txt |
2614 | -version: 3.0.0pr2 |
2615 | -*/ |
2616 | -YUI.add('anim-curve', function(Y) { |
2617 | - |
2618 | -/** |
2619 | - * Adds support for the <code>curve</code> property for the <code>to</code> |
2620 | - * attribute. A curve is zero or more control points and an end point. |
2621 | - * @module anim |
2622 | - * @submodule anim-curve |
2623 | - * @for Anim |
2624 | - */ |
2625 | - |
2626 | -Y.Anim.behaviors.curve = { |
2627 | - set: function(anim, att, from, to, elapsed, duration, fn) { |
2628 | - from = from.slice.call(from); |
2629 | - to = to.slice.call(to); |
2630 | - var t = fn(elapsed, 0, 100, duration) / 100; |
2631 | - to.unshift(from); |
2632 | - anim._node.setXY(Y.Anim.getBezier(to, t)); |
2633 | - }, |
2634 | - |
2635 | - get: function(anim, att) { |
2636 | - return anim._node.getXY(); |
2637 | - } |
2638 | -}; |
2639 | - |
2640 | -/** |
2641 | - * Get the current position of the animated element based on t. |
2642 | - * Each point is an array of "x" and "y" values (0 = x, 1 = y) |
2643 | - * At least 2 points are required (start and end). |
2644 | - * First point is start. Last point is end. |
2645 | - * Additional control points are optional. |
2646 | - * @method getBezier |
2647 | - * @static |
2648 | - * @param {Array} points An array containing Bezier points |
2649 | - * @param {Number} t A number between 0 and 1 which is the basis for determining current position |
2650 | - * @return {Array} An array containing int x and y member data |
2651 | - */ |
2652 | -Y.Anim.getBezier = function(points, t) { |
2653 | - var n = points.length; |
2654 | - var tmp = []; |
2655 | - |
2656 | - for (var i = 0; i < n; ++i){ |
2657 | - tmp[i] = [points[i][0], points[i][1]]; // save input |
2658 | - } |
2659 | - |
2660 | - for (var j = 1; j < n; ++j) { |
2661 | - for (i = 0; i < n - j; ++i) { |
2662 | - tmp[i][0] = (1 - t) * tmp[i][0] + t * tmp[parseInt(i + 1, 10)][0]; |
2663 | - tmp[i][1] = (1 - t) * tmp[i][1] + t * tmp[parseInt(i + 1, 10)][1]; |
2664 | - } |
2665 | - } |
2666 | - |
2667 | - return [ tmp[0][0], tmp[0][1] ]; |
2668 | - |
2669 | -}; |
2670 | - |
2671 | - |
2672 | -}, '3.0.0pr2' ,{requires:['anim-base', 'node-screen']}); |
2673 | |
2674 | === removed file 'src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-curve-min.js' |
2675 | --- src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-curve-min.js 2008-12-15 13:29:08 +0000 |
2676 | +++ src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-curve-min.js 1970-01-01 00:00:00 +0000 |
2677 | @@ -1,7 +0,0 @@ |
2678 | -/* |
2679 | -Copyright (c) 2008, Yahoo! Inc. All rights reserved. |
2680 | -Code licensed under the BSD License: |
2681 | -http://developer.yahoo.net/yui/license.txt |
2682 | -version: 3.0.0pr2 |
2683 | -*/ |
2684 | -YUI.add("anim-curve",function(A){A.Anim.behaviors.curve={set:function(F,C,I,H,B,G,E){I=I.slice.call(I);H=H.slice.call(H);var D=E(B,0,100,G)/100;H.unshift(I);F._node.setXY(A.Anim.getBezier(H,D));},get:function(C,B){return C._node.getXY();}};A.Anim.getBezier=function(F,E){var G=F.length;var D=[];for(var C=0;C<G;++C){D[C]=[F[C][0],F[C][1]];}for(var B=1;B<G;++B){for(C=0;C<G-B;++C){D[C][0]=(1-E)*D[C][0]+E*D[parseInt(C+1,10)][0];D[C][1]=(1-E)*D[C][1]+E*D[parseInt(C+1,10)][1];}}return[D[0][0],D[0][1]];};},"3.0.0pr2",{requires:["anim-base","node-screen"]}); |
2685 | \ No newline at end of file |
2686 | |
2687 | === removed file 'src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-curve.js' |
2688 | --- src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-curve.js 2008-12-15 13:29:08 +0000 |
2689 | +++ src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-curve.js 1970-01-01 00:00:00 +0000 |
2690 | @@ -1,63 +0,0 @@ |
2691 | -/* |
2692 | -Copyright (c) 2008, Yahoo! Inc. All rights reserved. |
2693 | -Code licensed under the BSD License: |
2694 | -http://developer.yahoo.net/yui/license.txt |
2695 | -version: 3.0.0pr2 |
2696 | -*/ |
2697 | -YUI.add('anim-curve', function(Y) { |
2698 | - |
2699 | -/** |
2700 | - * Adds support for the <code>curve</code> property for the <code>to</code> |
2701 | - * attribute. A curve is zero or more control points and an end point. |
2702 | - * @module anim |
2703 | - * @submodule anim-curve |
2704 | - * @for Anim |
2705 | - */ |
2706 | - |
2707 | -Y.Anim.behaviors.curve = { |
2708 | - set: function(anim, att, from, to, elapsed, duration, fn) { |
2709 | - from = from.slice.call(from); |
2710 | - to = to.slice.call(to); |
2711 | - var t = fn(elapsed, 0, 100, duration) / 100; |
2712 | - to.unshift(from); |
2713 | - anim._node.setXY(Y.Anim.getBezier(to, t)); |
2714 | - }, |
2715 | - |
2716 | - get: function(anim, att) { |
2717 | - return anim._node.getXY(); |
2718 | - } |
2719 | -}; |
2720 | - |
2721 | -/** |
2722 | - * Get the current position of the animated element based on t. |
2723 | - * Each point is an array of "x" and "y" values (0 = x, 1 = y) |
2724 | - * At least 2 points are required (start and end). |
2725 | - * First point is start. Last point is end. |
2726 | - * Additional control points are optional. |
2727 | - * @method getBezier |
2728 | - * @static |
2729 | - * @param {Array} points An array containing Bezier points |
2730 | - * @param {Number} t A number between 0 and 1 which is the basis for determining current position |
2731 | - * @return {Array} An array containing int x and y member data |
2732 | - */ |
2733 | -Y.Anim.getBezier = function(points, t) { |
2734 | - var n = points.length; |
2735 | - var tmp = []; |
2736 | - |
2737 | - for (var i = 0; i < n; ++i){ |
2738 | - tmp[i] = [points[i][0], points[i][1]]; // save input |
2739 | - } |
2740 | - |
2741 | - for (var j = 1; j < n; ++j) { |
2742 | - for (i = 0; i < n - j; ++i) { |
2743 | - tmp[i][0] = (1 - t) * tmp[i][0] + t * tmp[parseInt(i + 1, 10)][0]; |
2744 | - tmp[i][1] = (1 - t) * tmp[i][1] + t * tmp[parseInt(i + 1, 10)][1]; |
2745 | - } |
2746 | - } |
2747 | - |
2748 | - return [ tmp[0][0], tmp[0][1] ]; |
2749 | - |
2750 | -}; |
2751 | - |
2752 | - |
2753 | -}, '3.0.0pr2' ,{requires:['anim-base', 'node-screen']}); |
2754 | |
2755 | === removed file 'src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-debug.js' |
2756 | --- src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-debug.js 2008-12-15 13:29:08 +0000 |
2757 | +++ src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-debug.js 1970-01-01 00:00:00 +0000 |
2758 | @@ -1,1106 +0,0 @@ |
2759 | -/* |
2760 | -Copyright (c) 2008, Yahoo! Inc. All rights reserved. |
2761 | -Code licensed under the BSD License: |
2762 | -http://developer.yahoo.net/yui/license.txt |
2763 | -version: 3.0.0pr2 |
2764 | -*/ |
2765 | -YUI.add('anim', function(Y) { |
2766 | - |
2767 | -/** |
2768 | - * Y.Animation Utility. |
2769 | - * @module anim |
2770 | - */ |
2771 | - |
2772 | - /** |
2773 | - * Handles animation _queueing and threading. |
2774 | - * @class Anim |
2775 | - * @constructor |
2776 | - * @extends Base |
2777 | - */ |
2778 | - |
2779 | - var RUNNING = 'running', |
2780 | - START_TIME = 'startTime', |
2781 | - ELAPSED_TIME = 'elapsedTime', |
2782 | - /** |
2783 | - * @event start |
2784 | - * @description fires when an animation begins. |
2785 | - * @param {Event} ev The start event. |
2786 | - * @type Event.Custom |
2787 | - */ |
2788 | - START = 'start', |
2789 | - |
2790 | - /** |
2791 | - * @event tween |
2792 | - * @description fires every frame of the animation. |
2793 | - * @param {Event} ev The tween event. |
2794 | - * @type Event.Custom |
2795 | - */ |
2796 | - TWEEN = 'tween', |
2797 | - |
2798 | - /** |
2799 | - * @event end |
2800 | - * @description fires after the animation completes. |
2801 | - * @param {Event} ev The end event. |
2802 | - * @type Event.Custom |
2803 | - */ |
2804 | - END = 'end', |
2805 | - NODE = 'node', |
2806 | - PAUSED = 'paused', |
2807 | - REVERSE = 'reverse', // TODO: cleanup |
2808 | - ITERATION_COUNT = 'iterationCount', |
2809 | - |
2810 | - NUM = Number; |
2811 | - |
2812 | - var _running = {}, |
2813 | - _instances = {}, |
2814 | - _timer; |
2815 | - |
2816 | - Y.Anim = function() { |
2817 | - Y.Anim.superclass.constructor.apply(this, arguments); |
2818 | - _instances[Y.stamp(this)] = this; |
2819 | - }; |
2820 | - |
2821 | - Y.Anim.NAME = 'anim'; |
2822 | - |
2823 | - /** |
2824 | - * Regex of properties that should use the default unit. |
2825 | - * |
2826 | - * @property RE_DEFAULT_UNIT |
2827 | - * @static |
2828 | - */ |
2829 | - Y.Anim.RE_DEFAULT_UNIT = /^width|height|top|right|bottom|left|margin.*|padding.*|border.*$/i; |
2830 | - |
2831 | - /** |
2832 | - * The default unit to use with properties that pass the RE_DEFAULT_UNIT test. |
2833 | - * |
2834 | - * @property DEFAULT_UNIT |
2835 | - * @static |
2836 | - */ |
2837 | - Y.Anim.DEFAULT_UNIT = 'px'; |
2838 | - |
2839 | - Y.Anim.DEFAULT_EASING = function (t, b, c, d) { |
2840 | - return c * t / d + b; // linear easing |
2841 | - }; |
2842 | - |
2843 | - /** |
2844 | - * Bucket for custom getters and setters |
2845 | - * |
2846 | - * @property behaviors |
2847 | - * @static |
2848 | - */ |
2849 | - Y.Anim.behaviors = { |
2850 | - left: { |
2851 | - get: function(anim, attr) { |
2852 | - return anim._getOffset(attr); |
2853 | - } |
2854 | - } |
2855 | - }; |
2856 | - |
2857 | - Y.Anim.behaviors.top = Y.Anim.behaviors.left; |
2858 | - |
2859 | - /** |
2860 | - * The default setter to use when setting object properties. |
2861 | - * |
2862 | - * @property DEFAULT_SETTER |
2863 | - * @static |
2864 | - */ |
2865 | - Y.Anim.DEFAULT_SETTER = function(anim, att, from, to, elapsed, duration, fn, unit) { |
2866 | - unit = unit || ''; |
2867 | - anim._node.setStyle(att, fn(elapsed, NUM(from), NUM(to) - NUM(from), duration) + unit); |
2868 | - }; |
2869 | - |
2870 | - /** |
2871 | - * The default getter to use when getting object properties. |
2872 | - * |
2873 | - * @property DEFAULT_GETTER |
2874 | - * @static |
2875 | - */ |
2876 | - Y.Anim.DEFAULT_GETTER = function(anim, prop) { |
2877 | - return anim._node.getComputedStyle(prop); |
2878 | - }; |
2879 | - |
2880 | - Y.Anim.ATTRS = { |
2881 | - /** |
2882 | - * The object to be animated. |
2883 | - * @attribute node |
2884 | - * @type Node |
2885 | - */ |
2886 | - node: { |
2887 | - set: function(node) { |
2888 | - node = Y.Node.get(node); |
2889 | - this._node = node; |
2890 | - if (!node) { |
2891 | - Y.fail('Y.Anim: invalid node: ' + node); |
2892 | - } |
2893 | - return node; |
2894 | - } |
2895 | - }, |
2896 | - |
2897 | - /** |
2898 | - * The length of the animation. Defaults to "1" (second). |
2899 | - * @attribute duration |
2900 | - * @type NUM |
2901 | - */ |
2902 | - duration: { |
2903 | - value: 1 |
2904 | - }, |
2905 | - |
2906 | - /** |
2907 | - * The method that will provide values to the attribute(s) during the animation. |
2908 | - * Defaults to "Easing.easeNone". |
2909 | - * @attribute easing |
2910 | - * @type Function |
2911 | - */ |
2912 | - easing: { |
2913 | - value: Y.Anim.DEFAULT_EASING, |
2914 | - |
2915 | - set: function(val) { |
2916 | - if (typeof val === 'string' && Y.Easing) { |
2917 | - return Y.Easing[val]; |
2918 | - } |
2919 | - } |
2920 | - }, |
2921 | - |
2922 | - /** |
2923 | - * The starting values for the animated properties. |
2924 | - * Fields may be strings, numbers, or functions. |
2925 | - * If a function is used, the return value becomes the from value. |
2926 | - * If no from value is specified, the DEFAULT_GETTER will be used. |
2927 | - * @attribute from |
2928 | - * @type Object |
2929 | - */ |
2930 | - from: {}, |
2931 | - |
2932 | - /** |
2933 | - * The ending values for the animated properties. |
2934 | - * Fields may be strings, numbers, or functions. |
2935 | - * @attribute to |
2936 | - * @type Object |
2937 | - */ |
2938 | - to: {}, |
2939 | - |
2940 | - /** |
2941 | - * Date stamp for the first frame of the animation. |
2942 | - * @attribute startTime |
2943 | - * @type Int |
2944 | - * @default 0 |
2945 | - * @readOnly |
2946 | - */ |
2947 | - startTime: { |
2948 | - value: 0, |
2949 | - readOnly: true |
2950 | - }, |
2951 | - |
2952 | - /** |
2953 | - * Current time the animation has been running. |
2954 | - * @attribute elapsedTime |
2955 | - * @type Int |
2956 | - * @default 0 |
2957 | - * @readOnly |
2958 | - */ |
2959 | - elapsedTime: { |
2960 | - value: 0, |
2961 | - readOnly: true |
2962 | - }, |
2963 | - |
2964 | - /** |
2965 | - * Whether or not the animation is currently running. |
2966 | - * @attribute running |
2967 | - * @type Boolean |
2968 | - * @default false |
2969 | - * @readOnly |
2970 | - */ |
2971 | - running: { |
2972 | - get: function() { |
2973 | - return !!_running[Y.stamp(this)]; |
2974 | - }, |
2975 | - value: false, |
2976 | - readOnly: true |
2977 | - }, |
2978 | - |
2979 | - /** |
2980 | - * The number of times the animation should run |
2981 | - * @attribute iterations |
2982 | - * @type Int |
2983 | - * @default 1 |
2984 | - */ |
2985 | - iterations: { |
2986 | - value: 1 |
2987 | - }, |
2988 | - |
2989 | - /** |
2990 | - * The number of iterations that have occurred. |
2991 | - * Resets when an animation ends (reaches iteration count or stop() called). |
2992 | - * @attribute iterationCount |
2993 | - * @type Int |
2994 | - * @default 0 |
2995 | - * @readOnly |
2996 | - */ |
2997 | - iterationCount: { |
2998 | - value: 0, |
2999 | - readOnly: true |
3000 | - }, |
3001 | - |
3002 | - /** |
3003 | - * How iterations of the animation should behave. |
3004 | - * Possible values are "normal" and "alternate". |
3005 | - * Normal will repeat the animation, alternate will reverse on every other pass. |
3006 | - * |
3007 | - * @attribute direction |
3008 | - * @type String |
3009 | - * @default "normal" |
3010 | - */ |
3011 | - direction: { |
3012 | - value: 'normal' // | alternate (fwd on odd, rev on even per spec) |
3013 | - }, |
3014 | - |
3015 | - /** |
3016 | - * Whether or not the animation is currently paused. |
3017 | - * @attribute running |
3018 | - * @type Boolean |
3019 | - * @default false |
3020 | - * @readOnly |
3021 | - */ |
3022 | - paused: { |
3023 | - readOnly: true, |
3024 | - value: false |
3025 | - }, |
3026 | - |
3027 | - /** |
3028 | - * If true, animation begins from last frame |
3029 | - * @attribute reverse |
3030 | - * @type Boolean |
3031 | - * @default false |
3032 | - */ |
3033 | - reverse: { |
3034 | - value: false |
3035 | - } |
3036 | - |
3037 | - |
3038 | - }; |
3039 | - |
3040 | - /** |
3041 | - * Runs all animation instances. |
3042 | - * @method run |
3043 | - * @static |
3044 | - */ |
3045 | - Y.Anim.run = function() { |
3046 | - for (var i in _instances) { |
3047 | - if (_instances[i].run) { |
3048 | - _instances[i].run(); |
3049 | - } |
3050 | - } |
3051 | - }; |
3052 | - |
3053 | - /** |
3054 | - * Pauses all animation instances. |
3055 | - * @method pause |
3056 | - * @static |
3057 | - */ |
3058 | - Y.Anim.pause = function() { |
3059 | - for (var i in _running) { // stop timer if nothing running |
3060 | - if (_running[i].pause) { |
3061 | - _running[i].pause(); |
3062 | - } |
3063 | - } |
3064 | - Y.Anim._stopTimer(); |
3065 | - }; |
3066 | - |
3067 | - /** |
3068 | - * Stops all animation instances. |
3069 | - * @method stop |
3070 | - * @static |
3071 | - */ |
3072 | - Y.Anim.stop = function() { |
3073 | - for (var i in _running) { // stop timer if nothing running |
3074 | - if (_running[i].stop) { |
3075 | - _running[i].stop(); |
3076 | - } |
3077 | - } |
3078 | - Y.Anim._stopTimer(); |
3079 | - }; |
3080 | - |
3081 | - Y.Anim._startTimer = function() { |
3082 | - if (!_timer) { |
3083 | - _timer = setInterval(Y.Anim._runFrame, 1); |
3084 | - } |
3085 | - }; |
3086 | - |
3087 | - Y.Anim._stopTimer = function() { |
3088 | - clearInterval(_timer); |
3089 | - _timer = 0; |
3090 | - }; |
3091 | - |
3092 | - /** |
3093 | - * Called per Interval to handle each animation frame. |
3094 | - * @method _runFrame |
3095 | - * @private |
3096 | - * @static |
3097 | - */ |
3098 | - Y.Anim._runFrame = function() { |
3099 | - var done = true; |
3100 | - for (var anim in _running) { |
3101 | - if (_running[anim]._runFrame) { |
3102 | - done = false; |
3103 | - _running[anim]._runFrame(); |
3104 | - } |
3105 | - } |
3106 | - |
3107 | - if (done) { |
3108 | - Y.Anim._stopTimer(); |
3109 | - } |
3110 | - }; |
3111 | - |
3112 | - Y.Anim.RE_UNITS = /^(-?\d*\.?\d*){1}(em|ex|px|in|cm|mm|pt|pc|%)*$/; |
3113 | - |
3114 | - var proto = { |
3115 | - /** |
3116 | - * Starts or resumes an animation. |
3117 | - * percent start time marker. |
3118 | - * @method run |
3119 | - * @chainable |
3120 | - */ |
3121 | - run: function() { |
3122 | - if (!this.get(RUNNING)) { |
3123 | - this._start(); |
3124 | - } else if (this.get(PAUSED)) { |
3125 | - this._resume(); |
3126 | - } |
3127 | - return this; |
3128 | - }, |
3129 | - |
3130 | - /** |
3131 | - * Pauses the animation and |
3132 | - * freezes it in its current state and time. |
3133 | - * Calling run() will continue where it left off. |
3134 | - * @method pause |
3135 | - * @chainable |
3136 | - */ |
3137 | - pause: function() { |
3138 | - if (this.get(RUNNING)) { |
3139 | - this._pause(); |
3140 | - } |
3141 | - return this; |
3142 | - }, |
3143 | - |
3144 | - /** |
3145 | - * Stops the animation and resets its time. |
3146 | - * @method stop |
3147 | - * @chainable |
3148 | - */ |
3149 | - stop: function(finish) { |
3150 | - if (this.get(RUNNING) || this.get(PAUSED)) { |
3151 | - this._end(finish); |
3152 | - } |
3153 | - return this; |
3154 | - }, |
3155 | - |
3156 | - _added: false, |
3157 | - |
3158 | - _start: function() { |
3159 | - this._set(START_TIME, new Date() - this.get(ELAPSED_TIME)); |
3160 | - this._actualFrames = 0; |
3161 | - if (!this.get(PAUSED)) { |
3162 | - this._initAttr(); |
3163 | - } |
3164 | - _running[Y.stamp(this)] = this; |
3165 | - Y.Anim._startTimer(); |
3166 | - |
3167 | - this.fire(START); |
3168 | - }, |
3169 | - |
3170 | - _pause: function() { |
3171 | - this._set(START_TIME, null); |
3172 | - this._set(PAUSED, true); |
3173 | - delete _running[Y.stamp(this)]; |
3174 | - |
3175 | - /** |
3176 | - * @event pause |
3177 | - * @description fires when an animation is paused. |
3178 | - * @param {Event} ev The pause event. |
3179 | - * @type Event.Custom |
3180 | - */ |
3181 | - this.fire('pause'); |
3182 | - }, |
3183 | - |
3184 | - _resume: function() { |
3185 | - this._set(PAUSED, false); |
3186 | - _running[Y.stamp(this)] = this; |
3187 | - |
3188 | - /** |
3189 | - * @event resume |
3190 | - * @description fires when an animation is resumed (run from pause). |
3191 | - * @param {Event} ev The pause event. |
3192 | - * @type Event.Custom |
3193 | - */ |
3194 | - this.fire('resume'); |
3195 | - }, |
3196 | - |
3197 | - _end: function(finish) { |
3198 | - this._set(START_TIME, null); |
3199 | - this._set(ELAPSED_TIME, 0); |
3200 | - this._set(PAUSED, false); |
3201 | - |
3202 | - delete _running[Y.stamp(this)]; |
3203 | - this.fire(END, {elapsed: this.get(ELAPSED_TIME)}); |
3204 | - }, |
3205 | - |
3206 | - _runFrame: function() { |
3207 | - var attr = this._runtimeAttr, |
3208 | - customAttr = Y.Anim.behaviors, |
3209 | - easing = attr.easing, |
3210 | - d = attr.duration, |
3211 | - t = new Date() - this.get(START_TIME), |
3212 | - reversed = this.get(REVERSE), |
3213 | - done = (t >= d), |
3214 | - lastFrame = d, |
3215 | - attribute, |
3216 | - setter; |
3217 | - |
3218 | - if (reversed) { |
3219 | - t = d - t; |
3220 | - done = (t <= 0); |
3221 | - lastFrame = 0; |
3222 | - } |
3223 | - |
3224 | - for (var i in attr) { |
3225 | - if (attr[i].to) { |
3226 | - attribute = attr[i]; |
3227 | - setter = (i in customAttr && 'set' in customAttr[i]) ? |
3228 | - customAttr[i].set : Y.Anim.DEFAULT_SETTER; |
3229 | - |
3230 | - if (!done) { |
3231 | - setter(this, i, attribute.from, attribute.to, t, d, easing, attribute.unit); |
3232 | - } else { // ensure final frame value is set |
3233 | - // TODO: handle keyframes |
3234 | - setter(this, i, attribute.from, attribute.to, lastFrame, d, easing, attribute.unit); |
3235 | - } |
3236 | - } |
3237 | - } |
3238 | - |
3239 | - this._actualFrames += 1; |
3240 | - this._set(ELAPSED_TIME, t); |
3241 | - |
3242 | - this.fire(TWEEN); |
3243 | - if (done) { |
3244 | - this._lastFrame(); |
3245 | - } |
3246 | - }, |
3247 | - |
3248 | - _lastFrame: function() { |
3249 | - var iter = this.get('iterations'), |
3250 | - iterCount = this.get(ITERATION_COUNT); |
3251 | - |
3252 | - iterCount += 1; |
3253 | - if (iter === 'infinite' || iterCount < iter) { |
3254 | - if (this.get('direction') === 'alternate') { |
3255 | - this.set(REVERSE, !this.get(REVERSE)); // flip it |
3256 | - } |
3257 | - /** |
3258 | - * @event iteration |
3259 | - * @description fires when an animation begins an iteration. |
3260 | - * @param {Event} ev The iteration event. |
3261 | - * @type Event.Custom |
3262 | - */ |
3263 | - this.fire('iteration'); |
3264 | - } else { |
3265 | - iterCount = 0; |
3266 | - this._end(); |
3267 | - } |
3268 | - |
3269 | - this._set(START_TIME, new Date()); |
3270 | - this._set(ITERATION_COUNT, iterCount); |
3271 | - }, |
3272 | - |
3273 | - _initAttr: function() { |
3274 | - var from = this.get('from') || {}, |
3275 | - to = this.get('to') || {}, |
3276 | - dur = this.get('duration') * 1000, |
3277 | - node = this.get(NODE), |
3278 | - easing = this.get('easing') || {}, |
3279 | - attr = {}, |
3280 | - customAttr = Y.Anim.behaviors, |
3281 | - unit, begin, end; |
3282 | - |
3283 | - Y.each(to, function(val, name) { |
3284 | - if (typeof val === 'function') { |
3285 | - val = val.call(this, node); |
3286 | - } |
3287 | - |
3288 | - begin = from[name]; |
3289 | - if (begin === undefined) { |
3290 | - begin = (name in customAttr && 'get' in customAttr[name]) ? |
3291 | - customAttr[name].get(this, name) : Y.Anim.DEFAULT_GETTER(this, name); |
3292 | - } else if (typeof begin === 'function') { |
3293 | - begin = begin.call(this, node); |
3294 | - } |
3295 | - |
3296 | - var mFrom = Y.Anim.RE_UNITS.exec(begin); |
3297 | - var mTo = Y.Anim.RE_UNITS.exec(val); |
3298 | - |
3299 | - begin = mFrom ? mFrom[1] : begin; |
3300 | - var end = mTo ? mTo[1] : val, |
3301 | - unit = mTo ? mTo[2] : mFrom ? mFrom[2] : ''; // one might be zero TODO: mixed units |
3302 | - |
3303 | - if (!unit && Y.Anim.RE_DEFAULT_UNIT.test(name)) { |
3304 | - unit = Y.Anim.DEFAULT_UNIT; |
3305 | - } |
3306 | - |
3307 | - if (!begin || !end) { |
3308 | - Y.fail('invalid "from" or "to" for "' + name + '"', 'Anim'); |
3309 | - return; |
3310 | - } |
3311 | - |
3312 | - attr[name] = { |
3313 | - from: begin, |
3314 | - to: end, |
3315 | - unit: unit |
3316 | - }; |
3317 | - |
3318 | - attr.duration = dur; |
3319 | - attr.easing = easing; |
3320 | - |
3321 | - }, this); |
3322 | - |
3323 | - this._runtimeAttr = attr; |
3324 | - }, |
3325 | - |
3326 | - |
3327 | - // TODO: move to computedStyle? (browsers dont agree on default computed offsets) |
3328 | - _getOffset: function(attr) { |
3329 | - var node = this._node, |
3330 | - val = node.getComputedStyle(attr), |
3331 | - get = (attr === 'left') ? 'getX': 'getY', |
3332 | - set = (attr === 'left') ? 'setX': 'setY'; |
3333 | - |
3334 | - if (val === 'auto') { |
3335 | - var position = node.getStyle('position'); |
3336 | - if (position === 'absolute' || position === 'fixed') { |
3337 | - val = node[get](); |
3338 | - node[set](val); |
3339 | - } else { |
3340 | - val = 0; |
3341 | - } |
3342 | - } |
3343 | - |
3344 | - return val; |
3345 | - } |
3346 | - }; |
3347 | - |
3348 | - Y.extend(Y.Anim, Y.Base, proto); |
3349 | -/* |
3350 | -TERMS OF USE - EASING EQUATIONS |
3351 | -Open source under the BSD License. |
3352 | -Copyright 2001 Robert Penner All rights reserved. |
3353 | - |
3354 | -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: |
3355 | - |
3356 | - * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. |
3357 | - * 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. |
3358 | - * 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. |
3359 | - |
3360 | -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
3361 | -*/ |
3362 | - |
3363 | -/** |
3364 | - * The easing module provides methods for customizing |
3365 | - * how an animation behaves during each run. |
3366 | - * @class Easing |
3367 | - * @module anim |
3368 | - * @submodule anim-easing |
3369 | - */ |
3370 | - |
3371 | -Y.Easing = { |
3372 | - |
3373 | - /** |
3374 | - * Uniform speed between points. |
3375 | - * @method easeNone |
3376 | - * @param {Number} t Time value used to compute current value |
3377 | - * @param {Number} b Starting value |
3378 | - * @param {Number} c Delta between start and end values |
3379 | - * @param {Number} d Total length of animation |
3380 | - * @return {Number} The computed value for the current animation frame |
3381 | - */ |
3382 | - easeNone: function (t, b, c, d) { |
3383 | - return c*t/d + b; |
3384 | - }, |
3385 | - |
3386 | - /** |
3387 | - * Begins slowly and accelerates towards end. (quadratic) |
3388 | - * @method easeIn |
3389 | - * @param {Number} t Time value used to compute current value |
3390 | - * @param {Number} b Starting value |
3391 | - * @param {Number} c Delta between start and end values |
3392 | - * @param {Number} d Total length of animation |
3393 | - * @return {Number} The computed value for the current animation frame |
3394 | - */ |
3395 | - easeIn: function (t, b, c, d) { |
3396 | - return c*(t/=d)*t + b; |
3397 | - }, |
3398 | - |
3399 | - /** |
3400 | - * Begins quickly and decelerates towards end. (quadratic) |
3401 | - * @method easeOut |
3402 | - * @param {Number} t Time value used to compute current value |
3403 | - * @param {Number} b Starting value |
3404 | - * @param {Number} c Delta between start and end values |
3405 | - * @param {Number} d Total length of animation |
3406 | - * @return {Number} The computed value for the current animation frame |
3407 | - */ |
3408 | - easeOut: function (t, b, c, d) { |
3409 | - return -c *(t/=d)*(t-2) + b; |
3410 | - }, |
3411 | - |
3412 | - /** |
3413 | - * Begins slowly and decelerates towards end. (quadratic) |
3414 | - * @method easeBoth |
3415 | - * @param {Number} t Time value used to compute current value |
3416 | - * @param {Number} b Starting value |
3417 | - * @param {Number} c Delta between start and end values |
3418 | - * @param {Number} d Total length of animation |
3419 | - * @return {Number} The computed value for the current animation frame |
3420 | - */ |
3421 | - easeBoth: function (t, b, c, d) { |
3422 | - if ((t/=d/2) < 1) { |
3423 | - return c/2*t*t + b; |
3424 | - } |
3425 | - |
3426 | - return -c/2 * ((--t)*(t-2) - 1) + b; |
3427 | - }, |
3428 | - |
3429 | - /** |
3430 | - * Begins slowly and accelerates towards end. (quartic) |
3431 | - * @method easeInStrong |
3432 | - * @param {Number} t Time value used to compute current value |
3433 | - * @param {Number} b Starting value |
3434 | - * @param {Number} c Delta between start and end values |
3435 | - * @param {Number} d Total length of animation |
3436 | - * @return {Number} The computed value for the current animation frame |
3437 | - */ |
3438 | - easeInStrong: function (t, b, c, d) { |
3439 | - return c*(t/=d)*t*t*t + b; |
3440 | - }, |
3441 | - |
3442 | - /** |
3443 | - * Begins quickly and decelerates towards end. (quartic) |
3444 | - * @method easeOutStrong |
3445 | - * @param {Number} t Time value used to compute current value |
3446 | - * @param {Number} b Starting value |
3447 | - * @param {Number} c Delta between start and end values |
3448 | - * @param {Number} d Total length of animation |
3449 | - * @return {Number} The computed value for the current animation frame |
3450 | - */ |
3451 | - easeOutStrong: function (t, b, c, d) { |
3452 | - return -c * ((t=t/d-1)*t*t*t - 1) + b; |
3453 | - }, |
3454 | - |
3455 | - /** |
3456 | - * Begins slowly and decelerates towards end. (quartic) |
3457 | - * @method easeBothStrong |
3458 | - * @param {Number} t Time value used to compute current value |
3459 | - * @param {Number} b Starting value |
3460 | - * @param {Number} c Delta between start and end values |
3461 | - * @param {Number} d Total length of animation |
3462 | - * @return {Number} The computed value for the current animation frame |
3463 | - */ |
3464 | - easeBothStrong: function (t, b, c, d) { |
3465 | - if ((t/=d/2) < 1) { |
3466 | - return c/2*t*t*t*t + b; |
3467 | - } |
3468 | - |
3469 | - return -c/2 * ((t-=2)*t*t*t - 2) + b; |
3470 | - }, |
3471 | - |
3472 | - /** |
3473 | - * Snap in elastic effect. |
3474 | - * @method elasticIn |
3475 | - * @param {Number} t Time value used to compute current value |
3476 | - * @param {Number} b Starting value |
3477 | - * @param {Number} c Delta between start and end values |
3478 | - * @param {Number} d Total length of animation |
3479 | - * @param {Number} a Amplitude (optional) |
3480 | - * @param {Number} p Period (optional) |
3481 | - * @return {Number} The computed value for the current animation frame |
3482 | - */ |
3483 | - |
3484 | - elasticIn: function (t, b, c, d, a, p) { |
3485 | - var s; |
3486 | - if (t === 0) { |
3487 | - return b; |
3488 | - } |
3489 | - if ( (t /= d) === 1 ) { |
3490 | - return b+c; |
3491 | - } |
3492 | - if (!p) { |
3493 | - p = d* 0.3; |
3494 | - } |
3495 | - |
3496 | - if (!a || a < Math.abs(c)) { |
3497 | - a = c; |
3498 | - s = p/4; |
3499 | - } |
3500 | - else { |
3501 | - s = p/(2*Math.PI) * Math.asin (c/a); |
3502 | - } |
3503 | - |
3504 | - return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b; |
3505 | - }, |
3506 | - |
3507 | - /** |
3508 | - * Snap out elastic effect. |
3509 | - * @method elasticOut |
3510 | - * @param {Number} t Time value used to compute current value |
3511 | - * @param {Number} b Starting value |
3512 | - * @param {Number} c Delta between start and end values |
3513 | - * @param {Number} d Total length of animation |
3514 | - * @param {Number} a Amplitude (optional) |
3515 | - * @param {Number} p Period (optional) |
3516 | - * @return {Number} The computed value for the current animation frame |
3517 | - */ |
3518 | - elasticOut: function (t, b, c, d, a, p) { |
3519 | - var s; |
3520 | - if (t === 0) { |
3521 | - return b; |
3522 | - } |
3523 | - if ( (t /= d) === 1 ) { |
3524 | - return b+c; |
3525 | - } |
3526 | - if (!p) { |
3527 | - p=d * 0.3; |
3528 | - } |
3529 | - |
3530 | - if (!a || a < Math.abs(c)) { |
3531 | - a = c; |
3532 | - s = p / 4; |
3533 | - } |
3534 | - else { |
3535 | - s = p/(2*Math.PI) * Math.asin (c/a); |
3536 | - } |
3537 | - |
3538 | - return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b; |
3539 | - }, |
3540 | - |
3541 | - /** |
3542 | - * Snap both elastic effect. |
3543 | - * @method elasticBoth |
3544 | - * @param {Number} t Time value used to compute current value |
3545 | - * @param {Number} b Starting value |
3546 | - * @param {Number} c Delta between start and end values |
3547 | - * @param {Number} d Total length of animation |
3548 | - * @param {Number} a Amplitude (optional) |
3549 | - * @param {Number} p Period (optional) |
3550 | - * @return {Number} The computed value for the current animation frame |
3551 | - */ |
3552 | - elasticBoth: function (t, b, c, d, a, p) { |
3553 | - var s; |
3554 | - if (t === 0) { |
3555 | - return b; |
3556 | - } |
3557 | - |
3558 | - if ( (t /= d/2) === 2 ) { |
3559 | - return b+c; |
3560 | - } |
3561 | - |
3562 | - if (!p) { |
3563 | - p = d*(0.3*1.5); |
3564 | - } |
3565 | - |
3566 | - if ( !a || a < Math.abs(c) ) { |
3567 | - a = c; |
3568 | - s = p/4; |
3569 | - } |
3570 | - else { |
3571 | - s = p/(2*Math.PI) * Math.asin (c/a); |
3572 | - } |
3573 | - |
3574 | - if (t < 1) { |
3575 | - return -0.5*(a*Math.pow(2,10*(t-=1)) * |
3576 | - Math.sin( (t*d-s)*(2*Math.PI)/p )) + b; |
3577 | - } |
3578 | - return a*Math.pow(2,-10*(t-=1)) * |
3579 | - Math.sin( (t*d-s)*(2*Math.PI)/p )*0.5 + c + b; |
3580 | - }, |
3581 | - |
3582 | - |
3583 | - /** |
3584 | - * Backtracks slightly, then reverses direction and moves to end. |
3585 | - * @method backIn |
3586 | - * @param {Number} t Time value used to compute current value |
3587 | - * @param {Number} b Starting value |
3588 | - * @param {Number} c Delta between start and end values |
3589 | - * @param {Number} d Total length of animation |
3590 | - * @param {Number} s Overshoot (optional) |
3591 | - * @return {Number} The computed value for the current animation frame |
3592 | - */ |
3593 | - backIn: function (t, b, c, d, s) { |
3594 | - if (s == undefined) { |
3595 | - s = 1.70158; |
3596 | - } |
3597 | - if (t === d) { |
3598 | - t -= 0.001; |
3599 | - } |
3600 | - return c*(t/=d)*t*((s+1)*t - s) + b; |
3601 | - }, |
3602 | - |
3603 | - /** |
3604 | - * Overshoots end, then reverses and comes back to end. |
3605 | - * @method backOut |
3606 | - * @param {Number} t Time value used to compute current value |
3607 | - * @param {Number} b Starting value |
3608 | - * @param {Number} c Delta between start and end values |
3609 | - * @param {Number} d Total length of animation |
3610 | - * @param {Number} s Overshoot (optional) |
3611 | - * @return {Number} The computed value for the current animation frame |
3612 | - */ |
3613 | - backOut: function (t, b, c, d, s) { |
3614 | - if (typeof s === 'undefined') { |
3615 | - s = 1.70158; |
3616 | - } |
3617 | - return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b; |
3618 | - }, |
3619 | - |
3620 | - /** |
3621 | - * Backtracks slightly, then reverses direction, overshoots end, |
3622 | - * then reverses and comes back to end. |
3623 | - * @method backBoth |
3624 | - * @param {Number} t Time value used to compute current value |
3625 | - * @param {Number} b Starting value |
3626 | - * @param {Number} c Delta between start and end values |
3627 | - * @param {Number} d Total length of animation |
3628 | - * @param {Number} s Overshoot (optional) |
3629 | - * @return {Number} The computed value for the current animation frame |
3630 | - */ |
3631 | - backBoth: function (t, b, c, d, s) { |
3632 | - if (typeof s === 'undefined') { |
3633 | - s = 1.70158; |
3634 | - } |
3635 | - |
3636 | - if ((t /= d/2 ) < 1) { |
3637 | - return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b; |
3638 | - } |
3639 | - return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b; |
3640 | - }, |
3641 | - |
3642 | - /** |
3643 | - * Bounce off of start. |
3644 | - * @method bounceIn |
3645 | - * @param {Number} t Time value used to compute current value |
3646 | - * @param {Number} b Starting value |
3647 | - * @param {Number} c Delta between start and end values |
3648 | - * @param {Number} d Total length of animation |
3649 | - * @return {Number} The computed value for the current animation frame |
3650 | - */ |
3651 | - bounceIn: function (t, b, c, d) { |
3652 | - return c - Y.Easing.bounceOut(d-t, 0, c, d) + b; |
3653 | - }, |
3654 | - |
3655 | - /** |
3656 | - * Bounces off end. |
3657 | - * @method bounceOut |
3658 | - * @param {Number} t Time value used to compute current value |
3659 | - * @param {Number} b Starting value |
3660 | - * @param {Number} c Delta between start and end values |
3661 | - * @param {Number} d Total length of animation |
3662 | - * @return {Number} The computed value for the current animation frame |
3663 | - */ |
3664 | - bounceOut: function (t, b, c, d) { |
3665 | - if ((t/=d) < (1/2.75)) { |
3666 | - return c*(7.5625*t*t) + b; |
3667 | - } else if (t < (2/2.75)) { |
3668 | - return c*(7.5625*(t-=(1.5/2.75))*t + 0.75) + b; |
3669 | - } else if (t < (2.5/2.75)) { |
3670 | - return c*(7.5625*(t-=(2.25/2.75))*t + 0.9375) + b; |
3671 | - } |
3672 | - return c*(7.5625*(t-=(2.625/2.75))*t + 0.984375) + b; |
3673 | - }, |
3674 | - |
3675 | - /** |
3676 | - * Bounces off start and end. |
3677 | - * @method bounceBoth |
3678 | - * @param {Number} t Time value used to compute current value |
3679 | - * @param {Number} b Starting value |
3680 | - * @param {Number} c Delta between start and end values |
3681 | - * @param {Number} d Total length of animation |
3682 | - * @return {Number} The computed value for the current animation frame |
3683 | - */ |
3684 | - bounceBoth: function (t, b, c, d) { |
3685 | - if (t < d/2) { |
3686 | - return Y.Easing.bounceIn(t * 2, 0, c, d) * 0.5 + b; |
3687 | - } |
3688 | - return Y.Easing.bounceOut(t * 2 - d, 0, c, d) * 0.5 + c * 0.5 + b; |
3689 | - } |
3690 | -}; |
3691 | -/** |
3692 | - * Adds support for the <code>xy</code> property in <code>from</code> and |
3693 | - * <code>to</code> attributes. |
3694 | - * @module anim |
3695 | - * @submodule anim-xy |
3696 | - * @for Anim |
3697 | - */ |
3698 | - |
3699 | -var NUM = Number; |
3700 | - |
3701 | -Y.Anim.behaviors.xy = { |
3702 | - set: function(anim, att, from, to, elapsed, duration, fn) { |
3703 | - anim._node.setXY([ |
3704 | - fn(elapsed, NUM(from[0]), NUM(to[0]) - NUM(from[0]), duration), |
3705 | - fn(elapsed, NUM(from[1]), NUM(to[1]) - NUM(from[1]), duration) |
3706 | - ]); |
3707 | - }, |
3708 | - get: function(anim) { |
3709 | - return anim._node.getXY(); |
3710 | - } |
3711 | -}; |
3712 | - |
3713 | -/** |
3714 | - * Adds support for color properties in <code>to</code> |
3715 | - * and <code>from</code> attributes. |
3716 | - * @module anim |
3717 | - * @submodule anim-color |
3718 | - * @for Anim |
3719 | - */ |
3720 | - |
3721 | -var NUM = Number; |
3722 | - |
3723 | -Y.Anim.behaviors.color = { |
3724 | - set: function(anim, att, from, to, elapsed, duration, fn) { |
3725 | - from = Y.Color.re_RGB.exec(Y.Color.toRGB(from)); |
3726 | - to = Y.Color.re_RGB.exec(Y.Color.toRGB(to)); |
3727 | - |
3728 | - if (!from || from.length < 3 || !to || to.length < 3) { |
3729 | - Y.fail('invalid from or to passed to color behavior'); |
3730 | - } |
3731 | - |
3732 | - anim._node.setStyle(att, 'rgb(' + [ |
3733 | - Math.floor(fn(elapsed, NUM(from[1]), NUM(to[1]) - NUM(from[1]), duration)), |
3734 | - Math.floor(fn(elapsed, NUM(from[2]), NUM(to[2]) - NUM(from[2]), duration)), |
3735 | - Math.floor(fn(elapsed, NUM(from[3]), NUM(to[3]) - NUM(from[3]), duration)) |
3736 | - ].join(', ') + ')'); |
3737 | - }, |
3738 | - |
3739 | - // TODO: default bgcolor const |
3740 | - get: function(anim, att) { |
3741 | - var val = anim._node.getComputedStyle(att); |
3742 | - val = (val === 'transparent') ? 'rgb(255, 255, 255)' : val; |
3743 | - return val; |
3744 | - } |
3745 | -}; |
3746 | - |
3747 | -Y.each(['backgroundColor', |
3748 | - 'borderColor', |
3749 | - 'borderTopColor', |
3750 | - 'borderRightColor', |
3751 | - 'borderBottomColor', |
3752 | - 'borderLeftColor'], |
3753 | - function(v, i) { |
3754 | - Y.Anim.behaviors[v] = Y.Anim.behaviors.color; |
3755 | - } |
3756 | -); |
3757 | -/** |
3758 | - * Adds support for the <code>scroll</code> property in <code>to</code> |
3759 | - * and <code>from</code> attributes. |
3760 | - * @module anim |
3761 | - * @submodule anim-scroll |
3762 | - * @for Anim |
3763 | - */ |
3764 | - |
3765 | -var NUM = Number; |
3766 | - |
3767 | -Y.Anim.behaviors.scroll = { |
3768 | - set: function(anim, att, from, to, elapsed, duration, fn) { |
3769 | - var |
3770 | - node = anim._node, |
3771 | - val = ([ |
3772 | - fn(elapsed, NUM(from[0]), NUM(to[0]) - NUM(from[0]), duration), |
3773 | - fn(elapsed, NUM(from[1]), NUM(to[1]) - NUM(from[1]), duration) |
3774 | - ]); |
3775 | - |
3776 | - if (val[0]) { |
3777 | - node.set('scrollLeft', val[0]); |
3778 | - } |
3779 | - |
3780 | - if (val[1]) { |
3781 | - node.set('scrollTop', val[1]); |
3782 | - } |
3783 | - }, |
3784 | - get: function(anim) { |
3785 | - var node = anim._node; |
3786 | - return [node.get('scrollLeft'), node.get('scrollTop')]; |
3787 | - } |
3788 | -}; |
3789 | - |
3790 | -/** |
3791 | - * Adds support for the <code>curve</code> property for the <code>to</code> |
3792 | - * attribute. A curve is zero or more control points and an end point. |
3793 | - * @module anim |
3794 | - * @submodule anim-curve |
3795 | - * @for Anim |
3796 | - */ |
3797 | - |
3798 | -Y.Anim.behaviors.curve = { |
3799 | - set: function(anim, att, from, to, elapsed, duration, fn) { |
3800 | - from = from.slice.call(from); |
3801 | - to = to.slice.call(to); |
3802 | - var t = fn(elapsed, 0, 100, duration) / 100; |
3803 | - to.unshift(from); |
3804 | - anim._node.setXY(Y.Anim.getBezier(to, t)); |
3805 | - }, |
3806 | - |
3807 | - get: function(anim, att) { |
3808 | - return anim._node.getXY(); |
3809 | - } |
3810 | -}; |
3811 | - |
3812 | -/** |
3813 | - * Get the current position of the animated element based on t. |
3814 | - * Each point is an array of "x" and "y" values (0 = x, 1 = y) |
3815 | - * At least 2 points are required (start and end). |
3816 | - * First point is start. Last point is end. |
3817 | - * Additional control points are optional. |
3818 | - * @method getBezier |
3819 | - * @static |
3820 | - * @param {Array} points An array containing Bezier points |
3821 | - * @param {Number} t A number between 0 and 1 which is the basis for determining current position |
3822 | - * @return {Array} An array containing int x and y member data |
3823 | - */ |
3824 | -Y.Anim.getBezier = function(points, t) { |
3825 | - var n = points.length; |
3826 | - var tmp = []; |
3827 | - |
3828 | - for (var i = 0; i < n; ++i){ |
3829 | - tmp[i] = [points[i][0], points[i][1]]; // save input |
3830 | - } |
3831 | - |
3832 | - for (var j = 1; j < n; ++j) { |
3833 | - for (i = 0; i < n - j; ++i) { |
3834 | - tmp[i][0] = (1 - t) * tmp[i][0] + t * tmp[parseInt(i + 1, 10)][0]; |
3835 | - tmp[i][1] = (1 - t) * tmp[i][1] + t * tmp[parseInt(i + 1, 10)][1]; |
3836 | - } |
3837 | - } |
3838 | - |
3839 | - return [ tmp[0][0], tmp[0][1] ]; |
3840 | - |
3841 | -}; |
3842 | -/** |
3843 | - * Binds an Anim instance to a Node instance |
3844 | - * @module anim |
3845 | - * @namespace plugin |
3846 | - * @submodule anim-node-plugin |
3847 | - */ |
3848 | - |
3849 | -var NodeFX = function(config) { |
3850 | - var config = Y.merge(config); |
3851 | - config.node = config.owner; |
3852 | - NodeFX.superclass.constructor.apply(this, arguments); |
3853 | -}; |
3854 | - |
3855 | -NodeFX.NAME = "nodefx"; |
3856 | -NodeFX.NS = "fx"; |
3857 | - |
3858 | -Y.extend(NodeFX, Y.Anim); |
3859 | - |
3860 | -Y.namespace('plugin'); |
3861 | -Y.plugin.NodeFX = NodeFX; |
3862 | - |
3863 | - |
3864 | -}, '3.0.0pr2' ,{requires:['base', 'node']}); |
3865 | |
3866 | === removed file 'src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-easing-debug.js' |
3867 | --- src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-easing-debug.js 2008-12-15 13:29:08 +0000 |
3868 | +++ src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-easing-debug.js 1970-01-01 00:00:00 +0000 |
3869 | @@ -1,353 +0,0 @@ |
3870 | -/* |
3871 | -Copyright (c) 2008, Yahoo! Inc. All rights reserved. |
3872 | -Code licensed under the BSD License: |
3873 | -http://developer.yahoo.net/yui/license.txt |
3874 | -version: 3.0.0pr2 |
3875 | -*/ |
3876 | -YUI.add('anim-easing', function(Y) { |
3877 | - |
3878 | -/* |
3879 | -TERMS OF USE - EASING EQUATIONS |
3880 | -Open source under the BSD License. |
3881 | -Copyright 2001 Robert Penner All rights reserved. |
3882 | - |
3883 | -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: |
3884 | - |
3885 | - * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. |
3886 | - * 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. |
3887 | - * 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. |
3888 | - |
3889 | -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
3890 | -*/ |
3891 | - |
3892 | -/** |
3893 | - * The easing module provides methods for customizing |
3894 | - * how an animation behaves during each run. |
3895 | - * @class Easing |
3896 | - * @module anim |
3897 | - * @submodule anim-easing |
3898 | - */ |
3899 | - |
3900 | -Y.Easing = { |
3901 | - |
3902 | - /** |
3903 | - * Uniform speed between points. |
3904 | - * @method easeNone |
3905 | - * @param {Number} t Time value used to compute current value |
3906 | - * @param {Number} b Starting value |
3907 | - * @param {Number} c Delta between start and end values |
3908 | - * @param {Number} d Total length of animation |
3909 | - * @return {Number} The computed value for the current animation frame |
3910 | - */ |
3911 | - easeNone: function (t, b, c, d) { |
3912 | - return c*t/d + b; |
3913 | - }, |
3914 | - |
3915 | - /** |
3916 | - * Begins slowly and accelerates towards end. (quadratic) |
3917 | - * @method easeIn |
3918 | - * @param {Number} t Time value used to compute current value |
3919 | - * @param {Number} b Starting value |
3920 | - * @param {Number} c Delta between start and end values |
3921 | - * @param {Number} d Total length of animation |
3922 | - * @return {Number} The computed value for the current animation frame |
3923 | - */ |
3924 | - easeIn: function (t, b, c, d) { |
3925 | - return c*(t/=d)*t + b; |
3926 | - }, |
3927 | - |
3928 | - /** |
3929 | - * Begins quickly and decelerates towards end. (quadratic) |
3930 | - * @method easeOut |
3931 | - * @param {Number} t Time value used to compute current value |
3932 | - * @param {Number} b Starting value |
3933 | - * @param {Number} c Delta between start and end values |
3934 | - * @param {Number} d Total length of animation |
3935 | - * @return {Number} The computed value for the current animation frame |
3936 | - */ |
3937 | - easeOut: function (t, b, c, d) { |
3938 | - return -c *(t/=d)*(t-2) + b; |
3939 | - }, |
3940 | - |
3941 | - /** |
3942 | - * Begins slowly and decelerates towards end. (quadratic) |
3943 | - * @method easeBoth |
3944 | - * @param {Number} t Time value used to compute current value |
3945 | - * @param {Number} b Starting value |
3946 | - * @param {Number} c Delta between start and end values |
3947 | - * @param {Number} d Total length of animation |
3948 | - * @return {Number} The computed value for the current animation frame |
3949 | - */ |
3950 | - easeBoth: function (t, b, c, d) { |
3951 | - if ((t/=d/2) < 1) { |
3952 | - return c/2*t*t + b; |
3953 | - } |
3954 | - |
3955 | - return -c/2 * ((--t)*(t-2) - 1) + b; |
3956 | - }, |
3957 | - |
3958 | - /** |
3959 | - * Begins slowly and accelerates towards end. (quartic) |
3960 | - * @method easeInStrong |
3961 | - * @param {Number} t Time value used to compute current value |
3962 | - * @param {Number} b Starting value |
3963 | - * @param {Number} c Delta between start and end values |
3964 | - * @param {Number} d Total length of animation |
3965 | - * @return {Number} The computed value for the current animation frame |
3966 | - */ |
3967 | - easeInStrong: function (t, b, c, d) { |
3968 | - return c*(t/=d)*t*t*t + b; |
3969 | - }, |
3970 | - |
3971 | - /** |
3972 | - * Begins quickly and decelerates towards end. (quartic) |
3973 | - * @method easeOutStrong |
3974 | - * @param {Number} t Time value used to compute current value |
3975 | - * @param {Number} b Starting value |
3976 | - * @param {Number} c Delta between start and end values |
3977 | - * @param {Number} d Total length of animation |
3978 | - * @return {Number} The computed value for the current animation frame |
3979 | - */ |
3980 | - easeOutStrong: function (t, b, c, d) { |
3981 | - return -c * ((t=t/d-1)*t*t*t - 1) + b; |
3982 | - }, |
3983 | - |
3984 | - /** |
3985 | - * Begins slowly and decelerates towards end. (quartic) |
3986 | - * @method easeBothStrong |
3987 | - * @param {Number} t Time value used to compute current value |
3988 | - * @param {Number} b Starting value |
3989 | - * @param {Number} c Delta between start and end values |
3990 | - * @param {Number} d Total length of animation |
3991 | - * @return {Number} The computed value for the current animation frame |
3992 | - */ |
3993 | - easeBothStrong: function (t, b, c, d) { |
3994 | - if ((t/=d/2) < 1) { |
3995 | - return c/2*t*t*t*t + b; |
3996 | - } |
3997 | - |
3998 | - return -c/2 * ((t-=2)*t*t*t - 2) + b; |
3999 | - }, |
4000 | - |
4001 | - /** |
4002 | - * Snap in elastic effect. |
4003 | - * @method elasticIn |
4004 | - * @param {Number} t Time value used to compute current value |
4005 | - * @param {Number} b Starting value |
4006 | - * @param {Number} c Delta between start and end values |
4007 | - * @param {Number} d Total length of animation |
4008 | - * @param {Number} a Amplitude (optional) |
4009 | - * @param {Number} p Period (optional) |
4010 | - * @return {Number} The computed value for the current animation frame |
4011 | - */ |
4012 | - |
4013 | - elasticIn: function (t, b, c, d, a, p) { |
4014 | - var s; |
4015 | - if (t === 0) { |
4016 | - return b; |
4017 | - } |
4018 | - if ( (t /= d) === 1 ) { |
4019 | - return b+c; |
4020 | - } |
4021 | - if (!p) { |
4022 | - p = d* 0.3; |
4023 | - } |
4024 | - |
4025 | - if (!a || a < Math.abs(c)) { |
4026 | - a = c; |
4027 | - s = p/4; |
4028 | - } |
4029 | - else { |
4030 | - s = p/(2*Math.PI) * Math.asin (c/a); |
4031 | - } |
4032 | - |
4033 | - return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b; |
4034 | - }, |
4035 | - |
4036 | - /** |
4037 | - * Snap out elastic effect. |
4038 | - * @method elasticOut |
4039 | - * @param {Number} t Time value used to compute current value |
4040 | - * @param {Number} b Starting value |
4041 | - * @param {Number} c Delta between start and end values |
4042 | - * @param {Number} d Total length of animation |
4043 | - * @param {Number} a Amplitude (optional) |
4044 | - * @param {Number} p Period (optional) |
4045 | - * @return {Number} The computed value for the current animation frame |
4046 | - */ |
4047 | - elasticOut: function (t, b, c, d, a, p) { |
4048 | - var s; |
4049 | - if (t === 0) { |
4050 | - return b; |
4051 | - } |
4052 | - if ( (t /= d) === 1 ) { |
4053 | - return b+c; |
4054 | - } |
4055 | - if (!p) { |
4056 | - p=d * 0.3; |
4057 | - } |
4058 | - |
4059 | - if (!a || a < Math.abs(c)) { |
4060 | - a = c; |
4061 | - s = p / 4; |
4062 | - } |
4063 | - else { |
4064 | - s = p/(2*Math.PI) * Math.asin (c/a); |
4065 | - } |
4066 | - |
4067 | - return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b; |
4068 | - }, |
4069 | - |
4070 | - /** |
4071 | - * Snap both elastic effect. |
4072 | - * @method elasticBoth |
4073 | - * @param {Number} t Time value used to compute current value |
4074 | - * @param {Number} b Starting value |
4075 | - * @param {Number} c Delta between start and end values |
4076 | - * @param {Number} d Total length of animation |
4077 | - * @param {Number} a Amplitude (optional) |
4078 | - * @param {Number} p Period (optional) |
4079 | - * @return {Number} The computed value for the current animation frame |
4080 | - */ |
4081 | - elasticBoth: function (t, b, c, d, a, p) { |
4082 | - var s; |
4083 | - if (t === 0) { |
4084 | - return b; |
4085 | - } |
4086 | - |
4087 | - if ( (t /= d/2) === 2 ) { |
4088 | - return b+c; |
4089 | - } |
4090 | - |
4091 | - if (!p) { |
4092 | - p = d*(0.3*1.5); |
4093 | - } |
4094 | - |
4095 | - if ( !a || a < Math.abs(c) ) { |
4096 | - a = c; |
4097 | - s = p/4; |
4098 | - } |
4099 | - else { |
4100 | - s = p/(2*Math.PI) * Math.asin (c/a); |
4101 | - } |
4102 | - |
4103 | - if (t < 1) { |
4104 | - return -0.5*(a*Math.pow(2,10*(t-=1)) * |
4105 | - Math.sin( (t*d-s)*(2*Math.PI)/p )) + b; |
4106 | - } |
4107 | - return a*Math.pow(2,-10*(t-=1)) * |
4108 | - Math.sin( (t*d-s)*(2*Math.PI)/p )*0.5 + c + b; |
4109 | - }, |
4110 | - |
4111 | - |
4112 | - /** |
4113 | - * Backtracks slightly, then reverses direction and moves to end. |
4114 | - * @method backIn |
4115 | - * @param {Number} t Time value used to compute current value |
4116 | - * @param {Number} b Starting value |
4117 | - * @param {Number} c Delta between start and end values |
4118 | - * @param {Number} d Total length of animation |
4119 | - * @param {Number} s Overshoot (optional) |
4120 | - * @return {Number} The computed value for the current animation frame |
4121 | - */ |
4122 | - backIn: function (t, b, c, d, s) { |
4123 | - if (s == undefined) { |
4124 | - s = 1.70158; |
4125 | - } |
4126 | - if (t === d) { |
4127 | - t -= 0.001; |
4128 | - } |
4129 | - return c*(t/=d)*t*((s+1)*t - s) + b; |
4130 | - }, |
4131 | - |
4132 | - /** |
4133 | - * Overshoots end, then reverses and comes back to end. |
4134 | - * @method backOut |
4135 | - * @param {Number} t Time value used to compute current value |
4136 | - * @param {Number} b Starting value |
4137 | - * @param {Number} c Delta between start and end values |
4138 | - * @param {Number} d Total length of animation |
4139 | - * @param {Number} s Overshoot (optional) |
4140 | - * @return {Number} The computed value for the current animation frame |
4141 | - */ |
4142 | - backOut: function (t, b, c, d, s) { |
4143 | - if (typeof s === 'undefined') { |
4144 | - s = 1.70158; |
4145 | - } |
4146 | - return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b; |
4147 | - }, |
4148 | - |
4149 | - /** |
4150 | - * Backtracks slightly, then reverses direction, overshoots end, |
4151 | - * then reverses and comes back to end. |
4152 | - * @method backBoth |
4153 | - * @param {Number} t Time value used to compute current value |
4154 | - * @param {Number} b Starting value |
4155 | - * @param {Number} c Delta between start and end values |
4156 | - * @param {Number} d Total length of animation |
4157 | - * @param {Number} s Overshoot (optional) |
4158 | - * @return {Number} The computed value for the current animation frame |
4159 | - */ |
4160 | - backBoth: function (t, b, c, d, s) { |
4161 | - if (typeof s === 'undefined') { |
4162 | - s = 1.70158; |
4163 | - } |
4164 | - |
4165 | - if ((t /= d/2 ) < 1) { |
4166 | - return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b; |
4167 | - } |
4168 | - return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b; |
4169 | - }, |
4170 | - |
4171 | - /** |
4172 | - * Bounce off of start. |
4173 | - * @method bounceIn |
4174 | - * @param {Number} t Time value used to compute current value |
4175 | - * @param {Number} b Starting value |
4176 | - * @param {Number} c Delta between start and end values |
4177 | - * @param {Number} d Total length of animation |
4178 | - * @return {Number} The computed value for the current animation frame |
4179 | - */ |
4180 | - bounceIn: function (t, b, c, d) { |
4181 | - return c - Y.Easing.bounceOut(d-t, 0, c, d) + b; |
4182 | - }, |
4183 | - |
4184 | - /** |
4185 | - * Bounces off end. |
4186 | - * @method bounceOut |
4187 | - * @param {Number} t Time value used to compute current value |
4188 | - * @param {Number} b Starting value |
4189 | - * @param {Number} c Delta between start and end values |
4190 | - * @param {Number} d Total length of animation |
4191 | - * @return {Number} The computed value for the current animation frame |
4192 | - */ |
4193 | - bounceOut: function (t, b, c, d) { |
4194 | - if ((t/=d) < (1/2.75)) { |
4195 | - return c*(7.5625*t*t) + b; |
4196 | - } else if (t < (2/2.75)) { |
4197 | - return c*(7.5625*(t-=(1.5/2.75))*t + 0.75) + b; |
4198 | - } else if (t < (2.5/2.75)) { |
4199 | - return c*(7.5625*(t-=(2.25/2.75))*t + 0.9375) + b; |
4200 | - } |
4201 | - return c*(7.5625*(t-=(2.625/2.75))*t + 0.984375) + b; |
4202 | - }, |
4203 | - |
4204 | - /** |
4205 | - * Bounces off start and end. |
4206 | - * @method bounceBoth |
4207 | - * @param {Number} t Time value used to compute current value |
4208 | - * @param {Number} b Starting value |
4209 | - * @param {Number} c Delta between start and end values |
4210 | - * @param {Number} d Total length of animation |
4211 | - * @return {Number} The computed value for the current animation frame |
4212 | - */ |
4213 | - bounceBoth: function (t, b, c, d) { |
4214 | - if (t < d/2) { |
4215 | - return Y.Easing.bounceIn(t * 2, 0, c, d) * 0.5 + b; |
4216 | - } |
4217 | - return Y.Easing.bounceOut(t * 2 - d, 0, c, d) * 0.5 + c * 0.5 + b; |
4218 | - } |
4219 | -}; |
4220 | - |
4221 | - |
4222 | -}, '3.0.0pr2' ,{requires:['anim-base']}); |
4223 | |
4224 | === removed file 'src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-easing-min.js' |
4225 | --- src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-easing-min.js 2008-12-15 13:29:08 +0000 |
4226 | +++ src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-easing-min.js 1970-01-01 00:00:00 +0000 |
4227 | @@ -1,7 +0,0 @@ |
4228 | -/* |
4229 | -Copyright (c) 2008, Yahoo! Inc. All rights reserved. |
4230 | -Code licensed under the BSD License: |
4231 | -http://developer.yahoo.net/yui/license.txt |
4232 | -version: 3.0.0pr2 |
4233 | -*/ |
4234 | -YUI.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"]}); |
4235 | \ No newline at end of file |
4236 | |
4237 | === removed file 'src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-easing.js' |
4238 | --- src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-easing.js 2008-12-15 13:29:08 +0000 |
4239 | +++ src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-easing.js 1970-01-01 00:00:00 +0000 |
4240 | @@ -1,353 +0,0 @@ |
4241 | -/* |
4242 | -Copyright (c) 2008, Yahoo! Inc. All rights reserved. |
4243 | -Code licensed under the BSD License: |
4244 | -http://developer.yahoo.net/yui/license.txt |
4245 | -version: 3.0.0pr2 |
4246 | -*/ |
4247 | -YUI.add('anim-easing', function(Y) { |
4248 | - |
4249 | -/* |
4250 | -TERMS OF USE - EASING EQUATIONS |
4251 | -Open source under the BSD License. |
4252 | -Copyright 2001 Robert Penner All rights reserved. |
4253 | - |
4254 | -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: |
4255 | - |
4256 | - * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. |
4257 | - * 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. |
4258 | - * 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. |
4259 | - |
4260 | -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
4261 | -*/ |
4262 | - |
4263 | -/** |
4264 | - * The easing module provides methods for customizing |
4265 | - * how an animation behaves during each run. |
4266 | - * @class Easing |
4267 | - * @module anim |
4268 | - * @submodule anim-easing |
4269 | - */ |
4270 | - |
4271 | -Y.Easing = { |
4272 | - |
4273 | - /** |
4274 | - * Uniform speed between points. |
4275 | - * @method easeNone |
4276 | - * @param {Number} t Time value used to compute current value |
4277 | - * @param {Number} b Starting value |
4278 | - * @param {Number} c Delta between start and end values |
4279 | - * @param {Number} d Total length of animation |
4280 | - * @return {Number} The computed value for the current animation frame |
4281 | - */ |
4282 | - easeNone: function (t, b, c, d) { |
4283 | - return c*t/d + b; |
4284 | - }, |
4285 | - |
4286 | - /** |
4287 | - * Begins slowly and accelerates towards end. (quadratic) |
4288 | - * @method easeIn |
4289 | - * @param {Number} t Time value used to compute current value |
4290 | - * @param {Number} b Starting value |
4291 | - * @param {Number} c Delta between start and end values |
4292 | - * @param {Number} d Total length of animation |
4293 | - * @return {Number} The computed value for the current animation frame |
4294 | - */ |
4295 | - easeIn: function (t, b, c, d) { |
4296 | - return c*(t/=d)*t + b; |
4297 | - }, |
4298 | - |
4299 | - /** |
4300 | - * Begins quickly and decelerates towards end. (quadratic) |
4301 | - * @method easeOut |
4302 | - * @param {Number} t Time value used to compute current value |
4303 | - * @param {Number} b Starting value |
4304 | - * @param {Number} c Delta between start and end values |
4305 | - * @param {Number} d Total length of animation |
4306 | - * @return {Number} The computed value for the current animation frame |
4307 | - */ |
4308 | - easeOut: function (t, b, c, d) { |
4309 | - return -c *(t/=d)*(t-2) + b; |
4310 | - }, |
4311 | - |
4312 | - /** |
4313 | - * Begins slowly and decelerates towards end. (quadratic) |
4314 | - * @method easeBoth |
4315 | - * @param {Number} t Time value used to compute current value |
4316 | - * @param {Number} b Starting value |
4317 | - * @param {Number} c Delta between start and end values |
4318 | - * @param {Number} d Total length of animation |
4319 | - * @return {Number} The computed value for the current animation frame |
4320 | - */ |
4321 | - easeBoth: function (t, b, c, d) { |
4322 | - if ((t/=d/2) < 1) { |
4323 | - return c/2*t*t + b; |
4324 | - } |
4325 | - |
4326 | - return -c/2 * ((--t)*(t-2) - 1) + b; |
4327 | - }, |
4328 | - |
4329 | - /** |
4330 | - * Begins slowly and accelerates towards end. (quartic) |
4331 | - * @method easeInStrong |
4332 | - * @param {Number} t Time value used to compute current value |
4333 | - * @param {Number} b Starting value |
4334 | - * @param {Number} c Delta between start and end values |
4335 | - * @param {Number} d Total length of animation |
4336 | - * @return {Number} The computed value for the current animation frame |
4337 | - */ |
4338 | - easeInStrong: function (t, b, c, d) { |
4339 | - return c*(t/=d)*t*t*t + b; |
4340 | - }, |
4341 | - |
4342 | - /** |
4343 | - * Begins quickly and decelerates towards end. (quartic) |
4344 | - * @method easeOutStrong |
4345 | - * @param {Number} t Time value used to compute current value |
4346 | - * @param {Number} b Starting value |
4347 | - * @param {Number} c Delta between start and end values |
4348 | - * @param {Number} d Total length of animation |
4349 | - * @return {Number} The computed value for the current animation frame |
4350 | - */ |
4351 | - easeOutStrong: function (t, b, c, d) { |
4352 | - return -c * ((t=t/d-1)*t*t*t - 1) + b; |
4353 | - }, |
4354 | - |
4355 | - /** |
4356 | - * Begins slowly and decelerates towards end. (quartic) |
4357 | - * @method easeBothStrong |
4358 | - * @param {Number} t Time value used to compute current value |
4359 | - * @param {Number} b Starting value |
4360 | - * @param {Number} c Delta between start and end values |
4361 | - * @param {Number} d Total length of animation |
4362 | - * @return {Number} The computed value for the current animation frame |
4363 | - */ |
4364 | - easeBothStrong: function (t, b, c, d) { |
4365 | - if ((t/=d/2) < 1) { |
4366 | - return c/2*t*t*t*t + b; |
4367 | - } |
4368 | - |
4369 | - return -c/2 * ((t-=2)*t*t*t - 2) + b; |
4370 | - }, |
4371 | - |
4372 | - /** |
4373 | - * Snap in elastic effect. |
4374 | - * @method elasticIn |
4375 | - * @param {Number} t Time value used to compute current value |
4376 | - * @param {Number} b Starting value |
4377 | - * @param {Number} c Delta between start and end values |
4378 | - * @param {Number} d Total length of animation |
4379 | - * @param {Number} a Amplitude (optional) |
4380 | - * @param {Number} p Period (optional) |
4381 | - * @return {Number} The computed value for the current animation frame |
4382 | - */ |
4383 | - |
4384 | - elasticIn: function (t, b, c, d, a, p) { |
4385 | - var s; |
4386 | - if (t === 0) { |
4387 | - return b; |
4388 | - } |
4389 | - if ( (t /= d) === 1 ) { |
4390 | - return b+c; |
4391 | - } |
4392 | - if (!p) { |
4393 | - p = d* 0.3; |
4394 | - } |
4395 | - |
4396 | - if (!a || a < Math.abs(c)) { |
4397 | - a = c; |
4398 | - s = p/4; |
4399 | - } |
4400 | - else { |
4401 | - s = p/(2*Math.PI) * Math.asin (c/a); |
4402 | - } |
4403 | - |
4404 | - return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b; |
4405 | - }, |
4406 | - |
4407 | - /** |
4408 | - * Snap out elastic effect. |
4409 | - * @method elasticOut |
4410 | - * @param {Number} t Time value used to compute current value |
4411 | - * @param {Number} b Starting value |
4412 | - * @param {Number} c Delta between start and end values |
4413 | - * @param {Number} d Total length of animation |
4414 | - * @param {Number} a Amplitude (optional) |
4415 | - * @param {Number} p Period (optional) |
4416 | - * @return {Number} The computed value for the current animation frame |
4417 | - */ |
4418 | - elasticOut: function (t, b, c, d, a, p) { |
4419 | - var s; |
4420 | - if (t === 0) { |
4421 | - return b; |
4422 | - } |
4423 | - if ( (t /= d) === 1 ) { |
4424 | - return b+c; |
4425 | - } |
4426 | - if (!p) { |
4427 | - p=d * 0.3; |
4428 | - } |
4429 | - |
4430 | - if (!a || a < Math.abs(c)) { |
4431 | - a = c; |
4432 | - s = p / 4; |
4433 | - } |
4434 | - else { |
4435 | - s = p/(2*Math.PI) * Math.asin (c/a); |
4436 | - } |
4437 | - |
4438 | - return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b; |
4439 | - }, |
4440 | - |
4441 | - /** |
4442 | - * Snap both elastic effect. |
4443 | - * @method elasticBoth |
4444 | - * @param {Number} t Time value used to compute current value |
4445 | - * @param {Number} b Starting value |
4446 | - * @param {Number} c Delta between start and end values |
4447 | - * @param {Number} d Total length of animation |
4448 | - * @param {Number} a Amplitude (optional) |
4449 | - * @param {Number} p Period (optional) |
4450 | - * @return {Number} The computed value for the current animation frame |
4451 | - */ |
4452 | - elasticBoth: function (t, b, c, d, a, p) { |
4453 | - var s; |
4454 | - if (t === 0) { |
4455 | - return b; |
4456 | - } |
4457 | - |
4458 | - if ( (t /= d/2) === 2 ) { |
4459 | - return b+c; |
4460 | - } |
4461 | - |
4462 | - if (!p) { |
4463 | - p = d*(0.3*1.5); |
4464 | - } |
4465 | - |
4466 | - if ( !a || a < Math.abs(c) ) { |
4467 | - a = c; |
4468 | - s = p/4; |
4469 | - } |
4470 | - else { |
4471 | - s = p/(2*Math.PI) * Math.asin (c/a); |
4472 | - } |
4473 | - |
4474 | - if (t < 1) { |
4475 | - return -0.5*(a*Math.pow(2,10*(t-=1)) * |
4476 | - Math.sin( (t*d-s)*(2*Math.PI)/p )) + b; |
4477 | - } |
4478 | - return a*Math.pow(2,-10*(t-=1)) * |
4479 | - Math.sin( (t*d-s)*(2*Math.PI)/p )*0.5 + c + b; |
4480 | - }, |
4481 | - |
4482 | - |
4483 | - /** |
4484 | - * Backtracks slightly, then reverses direction and moves to end. |
4485 | - * @method backIn |
4486 | - * @param {Number} t Time value used to compute current value |
4487 | - * @param {Number} b Starting value |
4488 | - * @param {Number} c Delta between start and end values |
4489 | - * @param {Number} d Total length of animation |
4490 | - * @param {Number} s Overshoot (optional) |
4491 | - * @return {Number} The computed value for the current animation frame |
4492 | - */ |
4493 | - backIn: function (t, b, c, d, s) { |
4494 | - if (s == undefined) { |
4495 | - s = 1.70158; |
4496 | - } |
4497 | - if (t === d) { |
4498 | - t -= 0.001; |
4499 | - } |
4500 | - return c*(t/=d)*t*((s+1)*t - s) + b; |
4501 | - }, |
4502 | - |
4503 | - /** |
4504 | - * Overshoots end, then reverses and comes back to end. |
4505 | - * @method backOut |
4506 | - * @param {Number} t Time value used to compute current value |
4507 | - * @param {Number} b Starting value |
4508 | - * @param {Number} c Delta between start and end values |
4509 | - * @param {Number} d Total length of animation |
4510 | - * @param {Number} s Overshoot (optional) |
4511 | - * @return {Number} The computed value for the current animation frame |
4512 | - */ |
4513 | - backOut: function (t, b, c, d, s) { |
4514 | - if (typeof s === 'undefined') { |
4515 | - s = 1.70158; |
4516 | - } |
4517 | - return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b; |
4518 | - }, |
4519 | - |
4520 | - /** |
4521 | - * Backtracks slightly, then reverses direction, overshoots end, |
4522 | - * then reverses and comes back to end. |
4523 | - * @method backBoth |
4524 | - * @param {Number} t Time value used to compute current value |
4525 | - * @param {Number} b Starting value |
4526 | - * @param {Number} c Delta between start and end values |
4527 | - * @param {Number} d Total length of animation |
4528 | - * @param {Number} s Overshoot (optional) |
4529 | - * @return {Number} The computed value for the current animation frame |
4530 | - */ |
4531 | - backBoth: function (t, b, c, d, s) { |
4532 | - if (typeof s === 'undefined') { |
4533 | - s = 1.70158; |
4534 | - } |
4535 | - |
4536 | - if ((t /= d/2 ) < 1) { |
4537 | - return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b; |
4538 | - } |
4539 | - return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b; |
4540 | - }, |
4541 | - |
4542 | - /** |
4543 | - * Bounce off of start. |
4544 | - * @method bounceIn |
4545 | - * @param {Number} t Time value used to compute current value |
4546 | - * @param {Number} b Starting value |
4547 | - * @param {Number} c Delta between start and end values |
4548 | - * @param {Number} d Total length of animation |
4549 | - * @return {Number} The computed value for the current animation frame |
4550 | - */ |
4551 | - bounceIn: function (t, b, c, d) { |
4552 | - return c - Y.Easing.bounceOut(d-t, 0, c, d) + b; |
4553 | - }, |
4554 | - |
4555 | - /** |
4556 | - * Bounces off end. |
4557 | - * @method bounceOut |
4558 | - * @param {Number} t Time value used to compute current value |
4559 | - * @param {Number} b Starting value |
4560 | - * @param {Number} c Delta between start and end values |
4561 | - * @param {Number} d Total length of animation |
4562 | - * @return {Number} The computed value for the current animation frame |
4563 | - */ |
4564 | - bounceOut: function (t, b, c, d) { |
4565 | - if ((t/=d) < (1/2.75)) { |
4566 | - return c*(7.5625*t*t) + b; |
4567 | - } else if (t < (2/2.75)) { |
4568 | - return c*(7.5625*(t-=(1.5/2.75))*t + 0.75) + b; |
4569 | - } else if (t < (2.5/2.75)) { |
4570 | - return c*(7.5625*(t-=(2.25/2.75))*t + 0.9375) + b; |
4571 | - } |
4572 | - return c*(7.5625*(t-=(2.625/2.75))*t + 0.984375) + b; |
4573 | - }, |
4574 | - |
4575 | - /** |
4576 | - * Bounces off start and end. |
4577 | - * @method bounceBoth |
4578 | - * @param {Number} t Time value used to compute current value |
4579 | - * @param {Number} b Starting value |
4580 | - * @param {Number} c Delta between start and end values |
4581 | - * @param {Number} d Total length of animation |
4582 | - * @return {Number} The computed value for the current animation frame |
4583 | - */ |
4584 | - bounceBoth: function (t, b, c, d) { |
4585 | - if (t < d/2) { |
4586 | - return Y.Easing.bounceIn(t * 2, 0, c, d) * 0.5 + b; |
4587 | - } |
4588 | - return Y.Easing.bounceOut(t * 2 - d, 0, c, d) * 0.5 + c * 0.5 + b; |
4589 | - } |
4590 | -}; |
4591 | - |
4592 | - |
4593 | -}, '3.0.0pr2' ,{requires:['anim-base']}); |
4594 | |
4595 | === removed file 'src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-min.js' |
4596 | --- src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-min.js 2008-12-15 13:29:08 +0000 |
4597 | +++ src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-min.js 1970-01-01 00:00:00 +0000 |
4598 | @@ -1,8 +0,0 @@ |
4599 | -/* |
4600 | -Copyright (c) 2008, Yahoo! Inc. All rights reserved. |
4601 | -Code licensed under the BSD License: |
4602 | -http://developer.yahoo.net/yui/license.txt |
4603 | -version: 3.0.0pr2 |
4604 | -*/ |
4605 | -YUI.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; |
4606 | -}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"]}); |
4607 | \ No newline at end of file |
4608 | |
4609 | === removed file 'src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-node-plugin-debug.js' |
4610 | --- src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-node-plugin-debug.js 2008-12-15 13:29:08 +0000 |
4611 | +++ src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-node-plugin-debug.js 1970-01-01 00:00:00 +0000 |
4612 | @@ -1,28 +0,0 @@ |
4613 | -/* |
4614 | -Copyright (c) 2008, Yahoo! Inc. All rights reserved. |
4615 | -Code licensed under the BSD License: |
4616 | -http://developer.yahoo.net/yui/license.txt |
4617 | -version: 3.0.0pr2 |
4618 | -*/ |
4619 | -YUI.add('anim-node-plugin', function(Y) { |
4620 | - |
4621 | -/** |
4622 | - * Binds an Anim instance to a Node instance |
4623 | - * @module anim |
4624 | - * @submodule anim-node-plugin |
4625 | - */ |
4626 | - |
4627 | -Y.namespace('Plugin'); |
4628 | -Y.Plugin.NodeFX = function(config) { |
4629 | - config.node = config.owner; |
4630 | - Y.Plugin.NodeFX.superclass.constructor.apply(this, arguments); |
4631 | -}; |
4632 | - |
4633 | -Y.Plugin.NodeFX.NAME = "nodefxplugin"; |
4634 | -Y.Plugin.NodeFX.NS = "fx"; |
4635 | - |
4636 | -Y.extend(Y.Plugin.NodeFX, Y.Anim); |
4637 | - |
4638 | - |
4639 | - |
4640 | -}, '3.0.0pr2' ,{requires:['anim-base', 'node-base']}); |
4641 | |
4642 | === removed file 'src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-node-plugin-min.js' |
4643 | --- src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-node-plugin-min.js 2008-12-15 13:29:08 +0000 |
4644 | +++ src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-node-plugin-min.js 1970-01-01 00:00:00 +0000 |
4645 | @@ -1,7 +0,0 @@ |
4646 | -/* |
4647 | -Copyright (c) 2008, Yahoo! Inc. All rights reserved. |
4648 | -Code licensed under the BSD License: |
4649 | -http://developer.yahoo.net/yui/license.txt |
4650 | -version: 3.0.0pr2 |
4651 | -*/ |
4652 | -YUI.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"]}); |
4653 | \ No newline at end of file |
4654 | |
4655 | === removed file 'src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-node-plugin.js' |
4656 | --- src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-node-plugin.js 2008-12-15 13:29:08 +0000 |
4657 | +++ src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-node-plugin.js 1970-01-01 00:00:00 +0000 |
4658 | @@ -1,28 +0,0 @@ |
4659 | -/* |
4660 | -Copyright (c) 2008, Yahoo! Inc. All rights reserved. |
4661 | -Code licensed under the BSD License: |
4662 | -http://developer.yahoo.net/yui/license.txt |
4663 | -version: 3.0.0pr2 |
4664 | -*/ |
4665 | -YUI.add('anim-node-plugin', function(Y) { |
4666 | - |
4667 | -/** |
4668 | - * Binds an Anim instance to a Node instance |
4669 | - * @module anim |
4670 | - * @submodule anim-node-plugin |
4671 | - */ |
4672 | - |
4673 | -Y.namespace('Plugin'); |
4674 | -Y.Plugin.NodeFX = function(config) { |
4675 | - config.node = config.owner; |
4676 | - Y.Plugin.NodeFX.superclass.constructor.apply(this, arguments); |
4677 | -}; |
4678 | - |
4679 | -Y.Plugin.NodeFX.NAME = "nodefxplugin"; |
4680 | -Y.Plugin.NodeFX.NS = "fx"; |
4681 | - |
4682 | -Y.extend(Y.Plugin.NodeFX, Y.Anim); |
4683 | - |
4684 | - |
4685 | - |
4686 | -}, '3.0.0pr2' ,{requires:['anim-base', 'node-base']}); |
4687 | |
4688 | === removed file 'src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-scroll-debug.js' |
4689 | --- src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-scroll-debug.js 2008-12-15 13:29:08 +0000 |
4690 | +++ src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-scroll-debug.js 1970-01-01 00:00:00 +0000 |
4691 | @@ -1,44 +0,0 @@ |
4692 | -/* |
4693 | -Copyright (c) 2008, Yahoo! Inc. All rights reserved. |
4694 | -Code licensed under the BSD License: |
4695 | -http://developer.yahoo.net/yui/license.txt |
4696 | -version: 3.0.0pr2 |
4697 | -*/ |
4698 | -YUI.add('anim-scroll', function(Y) { |
4699 | - |
4700 | -/** |
4701 | - * Adds support for the <code>scroll</code> property in <code>to</code> |
4702 | - * and <code>from</code> attributes. |
4703 | - * @module anim |
4704 | - * @submodule anim-scroll |
4705 | - * @for Anim |
4706 | - */ |
4707 | - |
4708 | -var NUM = Number; |
4709 | - |
4710 | -Y.Anim.behaviors.scroll = { |
4711 | - set: function(anim, att, from, to, elapsed, duration, fn) { |
4712 | - var |
4713 | - node = anim._node, |
4714 | - val = ([ |
4715 | - fn(elapsed, NUM(from[0]), NUM(to[0]) - NUM(from[0]), duration), |
4716 | - fn(elapsed, NUM(from[1]), NUM(to[1]) - NUM(from[1]), duration) |
4717 | - ]); |
4718 | - |
4719 | - if (val[0]) { |
4720 | - node.set('scrollLeft', val[0]); |
4721 | - } |
4722 | - |
4723 | - if (val[1]) { |
4724 | - node.set('scrollTop', val[1]); |
4725 | - } |
4726 | - }, |
4727 | - get: function(anim) { |
4728 | - var node = anim._node; |
4729 | - return [node.get('scrollLeft'), node.get('scrollTop')]; |
4730 | - } |
4731 | -}; |
4732 | - |
4733 | - |
4734 | - |
4735 | -}, '3.0.0pr2' ,{requires:['anim-base', 'node-base']}); |
4736 | |
4737 | === removed file 'src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-scroll-min.js' |
4738 | --- src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-scroll-min.js 2008-12-15 13:29:08 +0000 |
4739 | +++ src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-scroll-min.js 1970-01-01 00:00:00 +0000 |
4740 | @@ -1,7 +0,0 @@ |
4741 | -/* |
4742 | -Copyright (c) 2008, Yahoo! Inc. All rights reserved. |
4743 | -Code licensed under the BSD License: |
4744 | -http://developer.yahoo.net/yui/license.txt |
4745 | -version: 3.0.0pr2 |
4746 | -*/ |
4747 | -YUI.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"]}); |
4748 | \ No newline at end of file |
4749 | |
4750 | === removed file 'src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-scroll.js' |
4751 | --- src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-scroll.js 2008-12-15 13:29:08 +0000 |
4752 | +++ src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-scroll.js 1970-01-01 00:00:00 +0000 |
4753 | @@ -1,44 +0,0 @@ |
4754 | -/* |
4755 | -Copyright (c) 2008, Yahoo! Inc. All rights reserved. |
4756 | -Code licensed under the BSD License: |
4757 | -http://developer.yahoo.net/yui/license.txt |
4758 | -version: 3.0.0pr2 |
4759 | -*/ |
4760 | -YUI.add('anim-scroll', function(Y) { |
4761 | - |
4762 | -/** |
4763 | - * Adds support for the <code>scroll</code> property in <code>to</code> |
4764 | - * and <code>from</code> attributes. |
4765 | - * @module anim |
4766 | - * @submodule anim-scroll |
4767 | - * @for Anim |
4768 | - */ |
4769 | - |
4770 | -var NUM = Number; |
4771 | - |
4772 | -Y.Anim.behaviors.scroll = { |
4773 | - set: function(anim, att, from, to, elapsed, duration, fn) { |
4774 | - var |
4775 | - node = anim._node, |
4776 | - val = ([ |
4777 | - fn(elapsed, NUM(from[0]), NUM(to[0]) - NUM(from[0]), duration), |
4778 | - fn(elapsed, NUM(from[1]), NUM(to[1]) - NUM(from[1]), duration) |
4779 | - ]); |
4780 | - |
4781 | - if (val[0]) { |
4782 | - node.set('scrollLeft', val[0]); |
4783 | - } |
4784 | - |
4785 | - if (val[1]) { |
4786 | - node.set('scrollTop', val[1]); |
4787 | - } |
4788 | - }, |
4789 | - get: function(anim) { |
4790 | - var node = anim._node; |
4791 | - return [node.get('scrollLeft'), node.get('scrollTop')]; |
4792 | - } |
4793 | -}; |
4794 | - |
4795 | - |
4796 | - |
4797 | -}, '3.0.0pr2' ,{requires:['anim-base', 'node-base']}); |
4798 | |
4799 | === removed file 'src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-xy-debug.js' |
4800 | --- src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-xy-debug.js 2008-12-15 13:29:08 +0000 |
4801 | +++ src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-xy-debug.js 1970-01-01 00:00:00 +0000 |
4802 | @@ -1,33 +0,0 @@ |
4803 | -/* |
4804 | -Copyright (c) 2008, Yahoo! Inc. All rights reserved. |
4805 | -Code licensed under the BSD License: |
4806 | -http://developer.yahoo.net/yui/license.txt |
4807 | -version: 3.0.0pr2 |
4808 | -*/ |
4809 | -YUI.add('anim-xy', function(Y) { |
4810 | - |
4811 | -/** |
4812 | - * Adds support for the <code>xy</code> property in <code>from</code> and |
4813 | - * <code>to</code> attributes. |
4814 | - * @module anim |
4815 | - * @submodule anim-xy |
4816 | - * @for Anim |
4817 | - */ |
4818 | - |
4819 | -var NUM = Number; |
4820 | - |
4821 | -Y.Anim.behaviors.xy = { |
4822 | - set: function(anim, att, from, to, elapsed, duration, fn) { |
4823 | - anim._node.setXY([ |
4824 | - fn(elapsed, NUM(from[0]), NUM(to[0]) - NUM(from[0]), duration), |
4825 | - fn(elapsed, NUM(from[1]), NUM(to[1]) - NUM(from[1]), duration) |
4826 | - ]); |
4827 | - }, |
4828 | - get: function(anim) { |
4829 | - return anim._node.getXY(); |
4830 | - } |
4831 | -}; |
4832 | - |
4833 | - |
4834 | - |
4835 | -}, '3.0.0pr2' ,{requires:['anim-base', 'node-screen']}); |
4836 | |
4837 | === removed file 'src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-xy-min.js' |
4838 | --- src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-xy-min.js 2008-12-15 13:29:08 +0000 |
4839 | +++ src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-xy-min.js 1970-01-01 00:00:00 +0000 |
4840 | @@ -1,7 +0,0 @@ |
4841 | -/* |
4842 | -Copyright (c) 2008, Yahoo! Inc. All rights reserved. |
4843 | -Code licensed under the BSD License: |
4844 | -http://developer.yahoo.net/yui/license.txt |
4845 | -version: 3.0.0pr2 |
4846 | -*/ |
4847 | -YUI.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"]}); |
4848 | \ No newline at end of file |
4849 | |
4850 | === removed file 'src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-xy.js' |
4851 | --- src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-xy.js 2008-12-15 13:29:08 +0000 |
4852 | +++ src-js/lazrjs/yui/3.0.0pr2/build/anim/anim-xy.js 1970-01-01 00:00:00 +0000 |
4853 | @@ -1,33 +0,0 @@ |
4854 | -/* |
4855 | -Copyright (c) 2008, Yahoo! Inc. All rights reserved. |
4856 | -Code licensed under the BSD License: |
4857 | -http://developer.yahoo.net/yui/license.txt |
4858 | -version: 3.0.0pr2 |
4859 | -*/ |
4860 | -YUI.add('anim-xy', function(Y) { |
4861 | - |
4862 | -/** |
4863 | - * Adds support for the <code>xy</code> property in <code>from</code> and |
4864 | - * <code>to</code> attributes. |
4865 | - * @module anim |
4866 | - * @submodule anim-xy |
4867 | - * @for Anim |
4868 | - */ |
4869 | - |
4870 | -var NUM = Number; |
4871 | - |
4872 | -Y.Anim.behaviors.xy = { |
4873 | - set: function(anim, att, from, to, elapsed, duration, fn) { |
4874 | - anim._node.setXY([ |
4875 | - fn(elapsed, NUM(from[0]), NUM(to[0]) - NUM(from[0]), duration), |
4876 | - fn(elapsed, NUM(from[1]), NUM(to[1]) - NUM(from[1]), duration) |
4877 | - ]); |
4878 | - }, |
4879 | - get: function(anim) { |
4880 | - return anim._node.getXY(); |
4881 | - } |
4882 | -}; |
4883 | - |
4884 | - |
4885 | - |
4886 | -}, '3.0.0pr2' ,{requires:['anim-base', 'node-screen']}); |
4887 | |
4888 | === removed file 'src-js/lazrjs/yui/3.0.0pr2/build/anim/anim.js' |
4889 | --- src-js/lazrjs/yui/3.0.0pr2/build/anim/anim.js 2008-12-15 13:29:08 +0000 |
4890 | +++ src-js/lazrjs/yui/3.0.0pr2/build/anim/anim.js 1970-01-01 00:00:00 +0000 |
4891 | @@ -1,1106 +0,0 @@ |
4892 | -/* |
4893 | -Copyright (c) 2008, Yahoo! Inc. All rights reserved. |
4894 | -Code licensed under the BSD License: |
4895 | -http://developer.yahoo.net/yui/license.txt |
4896 | -version: 3.0.0pr2 |
4897 | -*/ |
4898 | -YUI.add('anim', function(Y) { |
4899 | - |
4900 | -/** |
4901 | - * Y.Animation Utility. |
4902 | - * @module anim |
4903 | - */ |
4904 | - |
4905 | - /** |
4906 | - * Handles animation _queueing and threading. |
4907 | - * @class Anim |
4908 | - * @constructor |
4909 | - * @extends Base |
4910 | - */ |
4911 | - |
4912 | - var RUNNING = 'running', |
4913 | - START_TIME = 'startTime', |
4914 | - ELAPSED_TIME = 'elapsedTime', |
4915 | - /** |
4916 | - * @event start |
4917 | - * @description fires when an animation begins. |
4918 | - * @param {Event} ev The start event. |
4919 | - * @type Event.Custom |
4920 | - */ |
4921 | - START = 'start', |
4922 | - |
4923 | - /** |
4924 | - * @event tween |
4925 | - * @description fires every frame of the animation. |
4926 | - * @param {Event} ev The tween event. |
4927 | - * @type Event.Custom |
4928 | - */ |
4929 | - TWEEN = 'tween', |
4930 | - |
4931 | - /** |
4932 | - * @event end |
4933 | - * @description fires after the animation completes. |
4934 | - * @param {Event} ev The end event. |
4935 | - * @type Event.Custom |
4936 | - */ |
4937 | - END = 'end', |
4938 | - NODE = 'node', |
4939 | - PAUSED = 'paused', |
4940 | - REVERSE = 'reverse', // TODO: cleanup |
4941 | - ITERATION_COUNT = 'iterationCount', |
4942 | - |
4943 | - NUM = Number; |
4944 | - |
4945 | - var _running = {}, |
4946 | - _instances = {}, |
4947 | - _timer; |
4948 | - |
4949 | - Y.Anim = function() { |
4950 | - Y.Anim.superclass.constructor.apply(this, arguments); |
4951 | - _instances[Y.stamp(this)] = this; |
4952 | - }; |
4953 | - |
4954 | - Y.Anim.NAME = 'anim'; |
4955 | - |
4956 | - /** |
4957 | - * Regex of properties that should use the default unit. |
4958 | - * |
4959 | - * @property RE_DEFAULT_UNIT |
4960 | - * @static |
4961 | - */ |
4962 | - Y.Anim.RE_DEFAULT_UNIT = /^width|height|top|right|bottom|left|margin.*|padding.*|border.*$/i; |
4963 | - |
4964 | - /** |
4965 | - * The default unit to use with properties that pass the RE_DEFAULT_UNIT test. |
4966 | - * |
4967 | - * @property DEFAULT_UNIT |
4968 | - * @static |
4969 | - */ |
4970 | - Y.Anim.DEFAULT_UNIT = 'px'; |
4971 | - |
4972 | - Y.Anim.DEFAULT_EASING = function (t, b, c, d) { |
4973 | - return c * t / d + b; // linear easing |
4974 | - }; |
4975 | - |
4976 | - /** |
4977 | - * Bucket for custom getters and setters |
4978 | - * |
4979 | - * @property behaviors |
4980 | - * @static |
4981 | - */ |
4982 | - Y.Anim.behaviors = { |
4983 | - left: { |
4984 | - get: function(anim, attr) { |
4985 | - return anim._getOffset(attr); |
4986 | - } |
4987 | - } |
4988 | - }; |
4989 | - |
4990 | - Y.Anim.behaviors.top = Y.Anim.behaviors.left; |
4991 | - |
4992 | - /** |
4993 | - * The default setter to use when setting object properties. |
4994 | - * |
4995 | - * @property DEFAULT_SETTER |
4996 | - * @static |
4997 | - */ |
4998 | - Y.Anim.DEFAULT_SETTER = function(anim, att, from, to, elapsed, duration, fn, unit) { |
4999 | - unit = unit || ''; |
5000 | - anim._node.setStyle(att, fn(elapsed, NUM(from), NUM(to) - NUM(from), duration) + unit); |
Provide implementation for animating multiple nodes (via a NodeList or a bare node).
Also, tests. Yay us.