C# Класс NovelTheory.Component.JavascriptHelper

Показать файл Открыть проект Примеры использования класса

Private Properties

Свойство Тип Описание
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

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

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

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

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

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

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

public AddFile ( string filename ) : System.Web.Mvc.MvcHtmlString
filename string
Результат System.Web.Mvc.MvcHtmlString

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

public AddInlineFile ( string text ) : System.Web.Mvc.MvcHtmlString
text string
Результат System.Web.Mvc.MvcHtmlString

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

Adds the inline script.
public AddInlineScript ( string text ) : System.Web.Mvc.MvcHtmlString
text string The text.
Результат System.Web.Mvc.MvcHtmlString

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

public AddNoScriptText ( string text ) : System.Web.Mvc.MvcHtmlString
text string
Результат System.Web.Mvc.MvcHtmlString

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

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

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

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

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

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

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

public static Create ( System.Web.Mvc.ViewContext vc ) : JavascriptHelper
vc System.Web.Mvc.ViewContext
Результат JavascriptHelper

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

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

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

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

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

Inserts the CSS.
Renders all css files
public InsertCss ( ) : System.Web.Mvc.MvcHtmlString
Результат System.Web.Mvc.MvcHtmlString

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

public InsertOnReady ( ) : System.Web.Mvc.MvcHtmlString
Результат System.Web.Mvc.MvcHtmlString

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

public InsertScripts ( ) : System.Web.Mvc.MvcHtmlString
Результат System.Web.Mvc.MvcHtmlString

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

Adds standard javascript files
public Std ( string std ) : string
std string a comma-separated list of script file ids.
Результат string