]>
git.wh0rd.org - tt-rss.git/blob - lib/dojo/NodeList-fx.js.uncompressed.js
1 define("dojo/NodeList-fx", ["dojo/_base/NodeList", "./_base/lang", "./_base/connect", "./_base/fx", "./fx"],
2 function(NodeList
, lang
, connectLib
, baseFx
, coreFx
) {
9 dojo["NodeList-fx"] = {
10 // summary: Adds dojo.fx animation support to dojo.query() by extending the NodeList class
11 // with additional FX functions. NodeList is the array-like object used to hold query results.
15 NodeList = dojo.NodeList;
18 lang
.extend(NodeList
, {
19 _anim: function(obj
, method
, args
){
21 var a
= coreFx
.combine(
22 this.map(function(item
){
23 var tmpArgs
= { node
: item
};
24 lang
.mixin(tmpArgs
, args
);
25 return obj
[method
](tmpArgs
);
28 return args
.auto
? a
.play() && this : a
; // dojo.Animation|dojo.NodeList
31 wipeIn: function(args
){
33 // wipe in all elements of this NodeList via `dojo.fx.wipeIn`
36 // Additional dojo.Animation arguments to mix into this set with the addition of
37 // an `auto` parameter.
39 // returns: dojo.Animation|dojo.NodeList
40 // A special args member `auto` can be passed to automatically play the animation.
41 // If args.auto is present, the original dojo.NodeList will be returned for further
42 // chaining. Otherwise the dojo.Animation instance is returned and must be .play()'ed
45 // Fade in all tables with class "blah":
46 // | dojo.query("table.blah").wipeIn().play();
49 // Utilizing `auto` to get the NodeList back:
50 // | dojo.query(".titles").wipeIn({ auto:true }).onclick(someFunction);
52 return this._anim(coreFx
, "wipeIn", args
); // dojo.Animation|dojo.NodeList
55 wipeOut: function(args
){
57 // wipe out all elements of this NodeList via `dojo.fx.wipeOut`
60 // Additional dojo.Animation arguments to mix into this set with the addition of
61 // an `auto` parameter.
63 // returns: dojo.Animation|dojo.NodeList
64 // A special args member `auto` can be passed to automatically play the animation.
65 // If args.auto is present, the original dojo.NodeList will be returned for further
66 // chaining. Otherwise the dojo.Animation instance is returned and must be .play()'ed
69 // Wipe out all tables with class "blah":
70 // | dojo.query("table.blah").wipeOut().play();
71 return this._anim(coreFx
, "wipeOut", args
); // dojo.Animation|dojo.NodeList
74 slideTo: function(args
){
76 // slide all elements of the node list to the specified place via `dojo.fx.slideTo`
79 // Additional dojo.Animation arguments to mix into this set with the addition of
80 // an `auto` parameter.
82 // returns: dojo.Animation|dojo.NodeList
83 // A special args member `auto` can be passed to automatically play the animation.
84 // If args.auto is present, the original dojo.NodeList will be returned for further
85 // chaining. Otherwise the dojo.Animation instance is returned and must be .play()'ed
88 // | Move all tables with class "blah" to 300/300:
89 // | dojo.query("table.blah").slideTo({
93 return this._anim(coreFx
, "slideTo", args
); // dojo.Animation|dojo.NodeList
97 fadeIn: function(args
){
99 // fade in all elements of this NodeList via `dojo.fadeIn`
102 // Additional dojo.Animation arguments to mix into this set with the addition of
103 // an `auto` parameter.
105 // returns: dojo.Animation|dojo.NodeList
106 // A special args member `auto` can be passed to automatically play the animation.
107 // If args.auto is present, the original dojo.NodeList will be returned for further
108 // chaining. Otherwise the dojo.Animation instance is returned and must be .play()'ed
111 // Fade in all tables with class "blah":
112 // | dojo.query("table.blah").fadeIn().play();
113 return this._anim(baseFx
, "fadeIn", args
); // dojo.Animation|dojo.NodeList
116 fadeOut: function(args
){
118 // fade out all elements of this NodeList via `dojo.fadeOut`
121 // Additional dojo.Animation arguments to mix into this set with the addition of
122 // an `auto` parameter.
124 // returns: dojo.Animation|dojo.NodeList
125 // A special args member `auto` can be passed to automatically play the animation.
126 // If args.auto is present, the original dojo.NodeList will be returned for further
127 // chaining. Otherwise the dojo.Animation instance is returned and must be .play()'ed
130 // Fade out all elements with class "zork":
131 // | dojo.query(".zork").fadeOut().play();
133 // Fade them on a delay and do something at the end:
134 // | var fo = dojo.query(".zork").fadeOut();
135 // | dojo.connect(fo, "onEnd", function(){ /*...*/ });
139 // | dojo.query("li").fadeOut({ auto:true }).filter(filterFn).forEach(doit);
141 return this._anim(baseFx
, "fadeOut", args
); // dojo.Animation|dojo.NodeList
144 animateProperty: function(args
){
146 // Animate all elements of this NodeList across the properties specified.
147 // syntax identical to `dojo.animateProperty`
150 // Additional dojo.Animation arguments to mix into this set with the addition of
151 // an `auto` parameter.
153 // returns: dojo.Animation|dojo.NodeList
154 // A special args member `auto` can be passed to automatically play the animation.
155 // If args.auto is present, the original dojo.NodeList will be returned for further
156 // chaining. Otherwise the dojo.Animation instance is returned and must be .play()'ed
159 // | dojo.query(".zork").animateProperty({
162 // | color: { start: "black", end: "white" },
163 // | left: { end: 300 }
168 // | dojo.query(".grue").animateProperty({
173 // | }).onclick(handler);
174 return this._anim(baseFx
, "animateProperty", args
); // dojo.Animation|dojo.NodeList
177 anim: function( /*Object*/ properties
,
178 /*Integer?*/ duration
,
179 /*Function?*/ easing
,
183 // Animate one or more CSS properties for all nodes in this list.
184 // The returned animation object will already be playing when it
185 // is returned. See the docs for `dojo.anim` for full details.
186 // properties: Object
187 // the properties to animate. does NOT support the `auto` parameter like other
188 // NodeList-fx methods.
189 // duration: Integer?
190 // Optional. The time to run the animations for
192 // Optional. The easing function to use.
194 // A function to be called when the animation ends
196 // how long to delay playing the returned animation
198 // Another way to fade out:
199 // | dojo.query(".thinger").anim({ opacity: 0 });
201 // animate all elements with the "thigner" class to a width of 500
202 // pixels over half a second
203 // | dojo.query(".thinger").anim({ width: 500 }, 700);
204 var canim
= coreFx
.combine(
205 this.map(function(item
){
206 return baseFx
.animateProperty({
208 properties
: properties
,
209 duration
: duration
||350,
215 connectLib
.connect(canim
, "onEnd", onEnd
);
217 return canim
.play(delay
||0); // dojo.Animation