C# Class NovelTheory.Component.JavascriptHelper

Afficher le fichier Open project: jamescurran/JavascriptHelper Class Usage Examples

Private Properties

Свойство Type Description
CombineUrl string
CombineUrlPath string
Create JavascriptHelper
InsertCss_Bundled System.Web.Mvc.MvcHtmlString
InsertCss_None System.Web.Mvc.MvcHtmlString
InsertDependancy int
InsertScripts_Bundled System.Web.Mvc.MvcHtmlString
InsertScripts_None System.Web.Mvc.MvcHtmlString
JavascriptHelper System
RenderCssFile void
RenderJavascriptBlocks void
RenderJavascriptFile void

Méthodes publiques

Méthode Description
AddFile ( string filename ) : System.Web.Mvc.MvcHtmlString
AddInlineFile ( string text ) : System.Web.Mvc.MvcHtmlString
AddInlineScript ( string text ) : System.Web.Mvc.MvcHtmlString

Adds the inline script.

AddNoScriptText ( string text ) : System.Web.Mvc.MvcHtmlString
AddOnReadyScript ( string text ) : string

Adds the on ready script.

accepts a block of script as text. Appended to script run on page ready. All on rendered, wrapped in a jQuery document ready event function, at the point of InsertOnReady()

AddScript ( string text ) : string

Adds the script.

accepts a block of script as text. Each call is rendered. All script from either AddScript methods is rendered in a block at the script insertion point.

AddScript ( string id, string text ) : string

Adds the script.

accepts a block of script as text. Multiple calls with the same id are rendered only once. All script from either AddScript methods is rendered in a block at the script insertion point.

Create ( System.Web.Mvc.ViewContext vc ) : JavascriptHelper
Create ( System.Web.WebPages.WebPageContext webPageContext ) : JavascriptHelper

Creates the specified web page context.

Used in @helper functions: var script = StateTheaterMvc.Component.JavascriptHelper.Create(WebPageContext.Current);

Create ( System.Web.Mvc.WebViewPage page ) : JavascriptHelper

Creates the specified page.

Used in view pages functions: var script = StateTheaterMvc.Component.JavascriptHelper.Create(this);

InsertCss ( ) : System.Web.Mvc.MvcHtmlString

Inserts the CSS.

Renders all css files

InsertOnReady ( ) : System.Web.Mvc.MvcHtmlString
InsertScripts ( ) : System.Web.Mvc.MvcHtmlString
Std ( string std ) : string

Adds standard javascript files

Private Methods

Méthode Description
CombineUrl ( string baseUrl ) : string
CombineUrlPath ( string path1, string path2 ) : string
Create ( System.Web.Mvc.HtmlHelper html ) : JavascriptHelper
InsertCss_Bundled ( transformType ttype ) : System.Web.Mvc.MvcHtmlString
InsertCss_None ( ) : System.Web.Mvc.MvcHtmlString
InsertDependancy ( string name, int pos ) : int

Inserts the details of a required javascript file into the list.

Places the details of the js script file known by name onto the list of files that will be included on this page. Designed to place new files at the end, and files they depend on just before them.

InsertScripts_Bundled ( transformType ttype ) : System.Web.Mvc.MvcHtmlString
InsertScripts_None ( ) : System.Web.Mvc.MvcHtmlString

Inserts the scripts.

Renders all script files & script blocks.

JavascriptHelper ( System.Web.Mvc.ViewContext vc ) : System
RenderCssFile ( TextWriter tw, string file ) : void
RenderJavascriptBlocks ( TextWriter sb ) : void
RenderJavascriptFile ( TextWriter sb, string file ) : void

Method Details

AddFile() public méthode

public AddFile ( string filename ) : System.Web.Mvc.MvcHtmlString
filename string
Résultat System.Web.Mvc.MvcHtmlString

AddInlineFile() public méthode

public AddInlineFile ( string text ) : System.Web.Mvc.MvcHtmlString
text string
Résultat System.Web.Mvc.MvcHtmlString

AddInlineScript() public méthode

Adds the inline script.
public AddInlineScript ( string text ) : System.Web.Mvc.MvcHtmlString
text string The text.
Résultat System.Web.Mvc.MvcHtmlString

AddNoScriptText() public méthode

public AddNoScriptText ( string text ) : System.Web.Mvc.MvcHtmlString
text string
Résultat System.Web.Mvc.MvcHtmlString

AddOnReadyScript() public méthode

Adds the on ready script.
accepts a block of script as text. Appended to script run on page ready. All on rendered, wrapped in a jQuery document ready event function, at the point of InsertOnReady()
public AddOnReadyScript ( string text ) : string
text string The text.
Résultat string

AddScript() public méthode

Adds the script.
accepts a block of script as text. Each call is rendered. All script from either AddScript methods is rendered in a block at the script insertion point.
public AddScript ( string text ) : string
text string The text.
Résultat string

AddScript() public méthode

Adds the script.
accepts a block of script as text. Multiple calls with the same id are rendered only once. All script from either AddScript methods is rendered in a block at the script insertion point.
public AddScript ( string id, string text ) : string
id string The id.
text string The text.
Résultat string

Create() public static méthode

public static Create ( System.Web.Mvc.ViewContext vc ) : JavascriptHelper
vc System.Web.Mvc.ViewContext
Résultat JavascriptHelper

Create() public static méthode

Creates the specified web page context.
Used in @helper functions: var script = StateTheaterMvc.Component.JavascriptHelper.Create(WebPageContext.Current);
public static Create ( System.Web.WebPages.WebPageContext webPageContext ) : JavascriptHelper
webPageContext System.Web.WebPages.WebPageContext The web page context.
Résultat JavascriptHelper

Create() public static méthode

Creates the specified page.
Used in view pages functions: var script = StateTheaterMvc.Component.JavascriptHelper.Create(this);
public static Create ( System.Web.Mvc.WebViewPage page ) : JavascriptHelper
page System.Web.Mvc.WebViewPage
Résultat JavascriptHelper

InsertCss() public méthode

Inserts the CSS.
Renders all css files
public InsertCss ( ) : System.Web.Mvc.MvcHtmlString
Résultat System.Web.Mvc.MvcHtmlString

InsertOnReady() public méthode

public InsertOnReady ( ) : System.Web.Mvc.MvcHtmlString
Résultat System.Web.Mvc.MvcHtmlString

InsertScripts() public méthode

public InsertScripts ( ) : System.Web.Mvc.MvcHtmlString
Résultat System.Web.Mvc.MvcHtmlString

Std() public méthode

Adds standard javascript files
public Std ( string std ) : string
std string a comma-separated list of script file ids.
Résultat string