C# Class Castle.MonoRail.Framework.Helpers.PrototypeHelper.JSGenerator

Pendent
Inheritance: DynamicDispatchSupport, IJSGenerator
Afficher le fichier Open project: nats/castle-1.0.3-mono

Méthodes publiques

Méthode Description
Alert ( object message ) : void

Shows a JS alert

AppendLine ( String content ) : void

Writes the content specified to the generator instance

This is for advanced scenarios and for the infrastructure. Usually not useful.

Assign ( String variable, String expression ) : void

Assigns a javascript variable with the expression.

BuildJSArguments ( object args ) : string

Builds the JS arguments.

Call ( object function ) : void

Calls the specified function with the optional arguments.

CreateCollectionGenerator ( string root ) : IJSCollectionGenerator

Creates a generator for a collection.

CreateElementGenerator ( string root ) : IJSElementGenerator

Creates a generator for an element.

Declare ( string variable ) : void

Declares the specified variable as null.

Hide ( ) : void

Hides the specified elements.

The elements must exist.

InsertHtml ( string position, string id, object renderOptions ) : void

Inserts a content snippet relative to the element specified by the id

The supported positions are Top, After, Before, Bottom

JSGenerator ( IRailsEngineContext context ) : System

Initializes a new instance of the JSGenerator class.

ReApply ( ) : void

Re-apply Behaviour css' rules.

Only makes sense if you are using the Behaviour javascript library.

Record ( IJSGenerator gen, string line ) : void

Records the specified line on the generator.

RedirectTo ( object url ) : void

Redirects to an url using the location.href. This is required as most ajax libs don't care for the redirect status in the http reply.

Remove ( ) : void

Remove the specified elements from the DOM.

The elements must exist.

RemoveTail ( IJSGenerator generator ) : void

Removes the tail.

Render ( object renderOptions ) : object

Outputs the content using the renderOptions approach.

If the renderOptions is a string, the content is escaped and quoted.

If the renderOptions is a dictionary, we extract the key partial and evaluate the template it points to. The content is escaped and quoted.

Replace ( String id, object renderOptions ) : void

Replaces the entire target element -- and not only its innerHTML -- by the content evaluated.

ReplaceHtml ( String id, object renderOptions ) : void

Replaces the content of the specified target element.

ReplaceTailByPeriod ( IJSGenerator generator ) : void

Replaces the tail by period.

Show ( ) : void

Shows the specified elements.

The elements must exist.

ToString ( ) : string

Returns a that represents the current .

Toggle ( ) : void

Toggles the display status of the specified elements.

The elements must exist.

VisualEffect ( String name, String element, IDictionary options ) : void

Generates a call to a scriptaculous' visual effect.

VisualEffectDropOut ( String element, IDictionary options ) : void

Generates a call to a scriptaculous' drop out visual effect.

Write ( String content ) : void

Writes the content specified to the generator instance

This is for advanced scenarios and for the infrastructure. Usually not useful.

Private Methods

Méthode Description
JSGenerator ( ) : System

Collects the public methods

JsEscape ( string content ) : string
JsEscapeWithSQuotes ( string content ) : string

Method Details

Alert() public méthode

Shows a JS alert
public Alert ( object message ) : void
message object The message to display.
Résultat void

AppendLine() public méthode

Writes the content specified to the generator instance
This is for advanced scenarios and for the infrastructure. Usually not useful.
public AppendLine ( String content ) : void
content String The content.
Résultat void

Assign() public méthode

Assigns a javascript variable with the expression.
public Assign ( String variable, String expression ) : void
variable String The target variable
expression String The right side expression
Résultat void

BuildJSArguments() public static méthode

Builds the JS arguments.
public static BuildJSArguments ( object args ) : string
args object The args.
Résultat string

Call() public méthode

Calls the specified function with the optional arguments.
public Call ( object function ) : void
function object The function name.
Résultat void

CreateCollectionGenerator() public méthode

Creates a generator for a collection.
public CreateCollectionGenerator ( string root ) : IJSCollectionGenerator
root string The root expression.
Résultat IJSCollectionGenerator

CreateElementGenerator() public méthode

Creates a generator for an element.
public CreateElementGenerator ( string root ) : IJSElementGenerator
root string The root expression.
Résultat IJSElementGenerator

Declare() public méthode

Declares the specified variable as null.
public Declare ( string variable ) : void
variable string The variable name.
Résultat void

Hide() public méthode

Hides the specified elements.
The elements must exist.
public Hide ( ) : void
Résultat void

InsertHtml() public méthode

Inserts a content snippet relative to the element specified by the id

The supported positions are Top, After, Before, Bottom

public InsertHtml ( string position, string id, object renderOptions ) : void
position string The position to insert the content relative to the element id
id string The target element id
renderOptions object Defines what to render
Résultat void

JSGenerator() public méthode

Initializes a new instance of the JSGenerator class.
public JSGenerator ( IRailsEngineContext context ) : System
context IRailsEngineContext The request context
Résultat System

ReApply() public méthode

Re-apply Behaviour css' rules.
Only makes sense if you are using the Behaviour javascript library.
public ReApply ( ) : void
Résultat void

Record() public static méthode

Records the specified line on the generator.
public static Record ( IJSGenerator gen, string line ) : void
gen IJSGenerator The gen.
line string The line.
Résultat void

RedirectTo() public méthode

Redirects to an url using the location.href. This is required as most ajax libs don't care for the redirect status in the http reply.
public RedirectTo ( object url ) : void
url object The URL.
Résultat void

Remove() public méthode

Remove the specified elements from the DOM.
The elements must exist.
public Remove ( ) : void
Résultat void

RemoveTail() public static méthode

Removes the tail.
public static RemoveTail ( IJSGenerator generator ) : void
generator IJSGenerator The generator.
Résultat void

Render() public méthode

Outputs the content using the renderOptions approach.

If the renderOptions is a string, the content is escaped and quoted.

If the renderOptions is a dictionary, we extract the key partial and evaluate the template it points to. The content is escaped and quoted.

public Render ( object renderOptions ) : object
renderOptions object The render options.
Résultat object

Replace() public méthode

Replaces the entire target element -- and not only its innerHTML -- by the content evaluated.
public Replace ( String id, object renderOptions ) : void
id String The target element id
renderOptions object Defines what to render
Résultat void

ReplaceHtml() public méthode

Replaces the content of the specified target element.
public ReplaceHtml ( String id, object renderOptions ) : void
id String The target element id
renderOptions object Defines what to render
Résultat void

ReplaceTailByPeriod() public static méthode

Replaces the tail by period.
public static ReplaceTailByPeriod ( IJSGenerator generator ) : void
generator IJSGenerator The generator.
Résultat void

Show() public méthode

Shows the specified elements.
The elements must exist.
public Show ( ) : void
Résultat void

ToString() public méthode

Returns a that represents the current .
public ToString ( ) : string
Résultat string

Toggle() public méthode

Toggles the display status of the specified elements.
The elements must exist.
public Toggle ( ) : void
Résultat void

VisualEffect() public méthode

Generates a call to a scriptaculous' visual effect.
public VisualEffect ( String name, String element, IDictionary options ) : void
name String The effect name.
element String The target element.
options IDictionary The optional options.
Résultat void

VisualEffectDropOut() public méthode

Generates a call to a scriptaculous' drop out visual effect.
public VisualEffectDropOut ( String element, IDictionary options ) : void
element String The target element.
options IDictionary The optional options.
Résultat void

Write() public méthode

Writes the content specified to the generator instance
This is for advanced scenarios and for the infrastructure. Usually not useful.
public Write ( String content ) : void
content String The content.
Résultat void