C# Класс Castle.MonoRail.Framework.Helpers.PrototypeHelper.JSGenerator

Pendent
Наследование: DynamicDispatchSupport, IJSGenerator
Показать файл Открыть проект

Открытые методы

Метод Описание
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.

Приватные методы

Метод Описание
JSGenerator ( ) : System

Collects the public methods

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

Описание методов

Alert() публичный Метод

Shows a JS alert
public Alert ( object message ) : void
message object The message to display.
Результат void

AppendLine() публичный Метод

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.
Результат void

Assign() публичный Метод

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
Результат void

BuildJSArguments() публичный статический Метод

Builds the JS arguments.
public static BuildJSArguments ( object args ) : string
args object The args.
Результат string

Call() публичный Метод

Calls the specified function with the optional arguments.
public Call ( object function ) : void
function object The function name.
Результат void

CreateCollectionGenerator() публичный Метод

Creates a generator for a collection.
public CreateCollectionGenerator ( string root ) : IJSCollectionGenerator
root string The root expression.
Результат IJSCollectionGenerator

CreateElementGenerator() публичный Метод

Creates a generator for an element.
public CreateElementGenerator ( string root ) : IJSElementGenerator
root string The root expression.
Результат IJSElementGenerator

Declare() публичный Метод

Declares the specified variable as null.
public Declare ( string variable ) : void
variable string The variable name.
Результат void

Hide() публичный Метод

Hides the specified elements.
The elements must exist.
public Hide ( ) : void
Результат void

InsertHtml() публичный Метод

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
Результат void

JSGenerator() публичный Метод

Initializes a new instance of the JSGenerator class.
public JSGenerator ( IRailsEngineContext context ) : System
context IRailsEngineContext The request context
Результат System

ReApply() публичный Метод

Re-apply Behaviour css' rules.
Only makes sense if you are using the Behaviour javascript library.
public ReApply ( ) : void
Результат void

Record() публичный статический Метод

Records the specified line on the generator.
public static Record ( IJSGenerator gen, string line ) : void
gen IJSGenerator The gen.
line string The line.
Результат void

RedirectTo() публичный Метод

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.
Результат void

Remove() публичный Метод

Remove the specified elements from the DOM.
The elements must exist.
public Remove ( ) : void
Результат void

RemoveTail() публичный статический Метод

Removes the tail.
public static RemoveTail ( IJSGenerator generator ) : void
generator IJSGenerator The generator.
Результат void

Render() публичный Метод

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.
Результат object

Replace() публичный Метод

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
Результат void

ReplaceHtml() публичный Метод

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
Результат void

ReplaceTailByPeriod() публичный статический Метод

Replaces the tail by period.
public static ReplaceTailByPeriod ( IJSGenerator generator ) : void
generator IJSGenerator The generator.
Результат void

Show() публичный Метод

Shows the specified elements.
The elements must exist.
public Show ( ) : void
Результат void

ToString() публичный Метод

Returns a that represents the current .
public ToString ( ) : string
Результат string

Toggle() публичный Метод

Toggles the display status of the specified elements.
The elements must exist.
public Toggle ( ) : void
Результат void

VisualEffect() публичный Метод

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.
Результат void

VisualEffectDropOut() публичный Метод

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.
Результат void

Write() публичный Метод

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.
Результат void