Minor style changes
[castle.git] / MonoRail / Castle.MonoRail.Framework / Helpers / Effects2Helper.cs
blob588b3c45ff4b224b44b30c2c637e32f7f1449908
1 // Copyright 2004-2007 Castle Project - http://www.castleproject.org/
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
15 namespace Castle.MonoRail.Framework.Helpers
17 using System;
19 /// <summary>
20 /// Exposes the effect script from Thomas Fuchs
21 /// (http://script.aculo.us, http://mir.aculo.us)
22 /// </summary>
23 /// <remarks>
24 /// Before using it, you must install the scripts. See <see cref="ScriptaculousHelper.InstallScripts"/>
25 /// </remarks>
26 [Obsolete("Use ScriptaculousHelper instead")]
27 public class Effects2Helper : ScriptaculousHelper
29 /// <summary>
30 /// Make an element appear. If the element was previously set to display:none;
31 /// inside the style attribute of the element, the effect will automatically
32 /// show the element.
33 /// </summary>
34 /// <remarks>
35 /// Microsoft Internet Explorer can only set opacity on elements that have a
36 /// 'layout'. To let an element have a layout, you must set some CSS
37 /// positional properties, like 'width' or 'height'.
38 /// </remarks>
39 /// <param name="elementId"></param>
40 /// <returns></returns>
41 public String Appear(String elementId)
43 return ScriptBlock( String.Format( "new Effect.Appear('{0}');", elementId ) );
46 /// <summary>
47 /// Makes an element fade away and takes it out of the document flow
48 /// at the end of the effect by setting the CSS display property to false.
49 /// </summary>
50 /// <remarks>
51 /// Works safely with most HTML block elements (like DIV and LI).
52 /// Microsoft Internet Explorer can only set opacity on elements that
53 /// have a 'layout'. To let an element have a layout, you must set some
54 /// CSS positional properties, like 'width' or 'height'.
55 /// </remarks>
56 /// <param name="elementId"></param>
57 /// <returns></returns>
58 public String Fade(String elementId)
60 return ScriptBlock( String.Format( "new Effect.Fade('{0}');", elementId ) );
63 /// <summary>
64 /// Gives the illusion of the element puffing away (like a in a cloud of smoke).
65 /// </summary>
66 /// <remarks>
67 /// Works safely with most HTML block elements (like DIV and LI).
68 /// </remarks>
69 /// <param name="elementId"></param>
70 /// <returns></returns>
71 public String Puff(String elementId)
73 return ScriptBlock( String.Format( "new Effect.Puff('{0}');", elementId ) );
76 /// <summary>
77 /// Makes the element drop and fade out at the same time.
78 /// </summary>
79 /// <remarks>
80 /// Works safely with most HTML block elements (like DIV and LI).
81 /// </remarks>
82 /// <param name="elementId"></param>
83 /// <returns></returns>
84 public String DropOut(String elementId)
86 return ScriptBlock( String.Format( "new Effect.DropOut('{0}');", elementId ) );
89 /// <summary>
90 /// Moves the element slightly to the left, then to the right, repeatedly.
91 /// </summary>
92 /// <remarks>
93 /// Works safely with most HTML block elements (like DIV and LI).
94 /// </remarks>
95 /// <param name="elementId"></param>
96 /// <returns></returns>
97 public String Shake(String elementId)
99 return ScriptBlock( String.Format( "new Effect.Shake('{0}');", elementId ) );
102 /// <summary>
103 /// Gives the illusion of a TV-style switch off.
104 /// </summary>
105 /// <remarks>
106 /// Works safely with most HTML block elements (like DIV and LI).
107 /// </remarks>
108 /// <param name="elementId"></param>
109 /// <returns></returns>
110 public String SwitchOff(String elementId)
112 return ScriptBlock( String.Format( "new Effect.SwitchOff('{0}');", elementId ) );
115 /// <summary>
116 /// This pair of effects simulates a window blind, where the
117 /// contents of the affected elements stay in place.
118 /// </summary>
119 /// <remarks>
120 /// Works safely with most HTML block elements (like DIV and LI),
121 /// except table rows, table bodies and table heads.
122 /// </remarks>
123 /// <param name="elementId"></param>
124 /// <returns></returns>
125 public String BlindUp(String elementId)
127 return ScriptBlock( String.Format( "new Effect.BlindUp('{0}');", elementId ) );
130 /// <summary>
131 /// This pair of effects simulates a window blind, where the
132 /// contents of the affected elements stay in place.
133 /// </summary>
134 /// <remarks>
135 /// Works safely with most HTML block elements (like DIV and LI),
136 /// except table rows, table bodies and table heads.
137 /// </remarks>
138 /// <param name="elementId"></param>
139 /// <returns></returns>
140 public String BlindDown(String elementId)
142 return ScriptBlock( String.Format( "new Effect.BlindDown('{0}');", elementId ) );
145 /// <summary>
146 /// This pair of effects simulates a window blind, where the contents of
147 /// the affected elements scroll up and down accordingly.
148 /// </summary>
149 /// <remarks>
150 /// You must include a second DIV element,
151 /// wrapping the contents of the outer DIV.
152 /// So, if you call new Effect.SlideDown('x'), your element must look like this:
153 /// <code>
154 /// &lt;div id="x"&gt;&lt;div&gt;contents&lt;/div&gt;&lt;/div&gt;
155 /// </code>
156 /// Because of a bug in Internet Explorer 6 (overflow not correctly hidden),
157 /// an additional wrapper div is needed if you want to use these effects on
158 /// absolutely positionend elements (wrapper is the absolutely positioned element,
159 /// x has position:relative; set; ):
160 /// <code>
161 /// &lt;div id="wrapper"&gt;
162 /// &lt;div id="x"&gt;&lt;div&gt;contents&lt;/div&gt;&lt;/div&gt;
163 /// &lt;/div&gt;
164 /// </code>
165 /// Works only on block elements.
166 /// </remarks>
167 /// <param name="elementId"></param>
168 /// <returns></returns>
169 public String SlideUp(String elementId)
171 return ScriptBlock( String.Format( "new Effect.SlideUp('{0}');", elementId ) );
174 /// <summary>
175 /// This pair of effects simulates a window blind, where the contents of
176 /// the affected elements scroll up and down accordingly.
177 /// </summary>
178 /// <remarks>
179 /// You must include a second DIV element,
180 /// wrapping the contents of the outer DIV.
181 /// So, if you call new Effect.SlideDown('x'), your element must look like this:
182 /// <code>
183 /// &lt;div id="x"&gt;&lt;div&gt;contents&lt;/div&gt;&lt;/div&gt;
184 /// </code>
185 /// Because of a bug in Internet Explorer 6 (overflow not correctly hidden),
186 /// an additional wrapper div is needed if you want to use these effects on
187 /// absolutely positionend elements (wrapper is the absolutely positioned element,
188 /// x has position:relative; set; ):
189 /// <code>
190 /// &lt;div id="wrapper"&gt;
191 /// &lt;div id="x"&gt;&lt;div&gt;contents&lt;/div&gt;&lt;/div&gt;
192 /// &lt;/div&gt;
193 /// </code>
194 /// Works only on block elements.
195 /// </remarks>
196 /// <param name="elementId"></param>
197 /// <returns></returns>
198 public String SlideDown(String elementId)
200 return ScriptBlock( String.Format( "new Effect.SlideDown('{0}');", elementId ) );