1 // Copyright 2004-2008 Castle Project - http://www.castleproject.org/
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
7 // http://www.apache.org/licenses/LICENSE-2.0
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
20 /// Just apply the CSS class "fade" to any element and it will fade from yellow
21 /// to its background color or white if none is specified.
23 /// Key Features <br/>
25 /// * Fade an infinite number of elements. <br/>
27 /// * No inline JavaScript. Simply give an element a class of "fade", the script does the rest "automagically". <br/>
29 /// * Background color aware. FAT will do better than simply fade to white if the element (or it's parents) have a
30 /// CSS background color, it will fade to that background color instead. <br/>
32 /// * Fade from any color. For example, if you wanted a list of error messages
33 /// to fade out from red you would simply give the list a class of "fade-FF0000". <br/>
35 /// * Super smooth fading. By default, elements will fade at 30 frames per second
36 /// (the same rate as a television) over 3 seconds. You can adjust this to any
37 /// framerate and any duration. You could easily fade elements at 60 frames
38 /// per second over 4, 5, 10 seconds! <br/>
42 /// NOTE: All elements to be faded must have an id tag!
43 /// BASIC USE: <p id="paragraph1" class="fade">Watch me fade</p>
44 /// ADVANCED USE: Change the default fade from color:
45 /// <p id="paragraph1" class="fade-0066FF">Watch me fade from Blue (#0066FF)</p>
46 /// SEE MORE HERE: http://www.axentric.com/posts/default/7
48 public class EffectsFatHelper
: AbstractHelper
52 /// Initializes a new instance of the <see cref="EffectsFatHelper"/> class.
54 public EffectsFatHelper() { }
56 /// Initializes a new instance of the <see cref="EffectsFatHelper"/> class.
57 /// setting the Controller, Context and ControllerContext.
59 /// <param name="engineContext">The engine context.</param>
60 public EffectsFatHelper(IEngineContext engineContext
) : base(engineContext
) { }
64 /// Renders a Javascript library inside a single script tag.
66 /// <returns></returns>
67 public String
InstallScripts()
69 return RenderScriptBlockToSource("/MonoRail/Files/EffectsFatScripts");
73 /// Renders a Javascript library inside a single script tag.
75 /// <returns></returns>
76 [Obsolete("Please use the preferred InstallScripts function.")]
77 public String
GetJavascriptFunctions()
79 return InstallScripts();