C# Class Open.Core.Helpers.TemplateHelper

Utility methods for working with jQuery Templates.
显示文件 Open project: philcockfield/Open.TestHarness.SL

Public Methods

Method Description
Download ( string url, System.Action onComplete ) : void

Downloads the template(s) at the specified URL and appends them to the body.

Get ( string selector ) : Template

Retrieves the specified Template singleton instance (downloading it if it has not already been pulled).

GetAsync ( string url, string selector, TemplateCallback callback ) : void

Retrieves a Template singleton instance (downloading it if it has not already been pulled).

IsAvailable ( string selector ) : bool

Gets whether a template at the given selector is available to use (it exists within the page).

IsDownloaded ( string url ) : bool

Determines whether the specified URL has been downloaded.

Private Methods

Method Description
Download ( string url ) : void
GetDownloadCallbacks ( string url ) : ArrayList
GetInternal ( string selector, bool checkCache ) : Template
IsDownloading ( string url ) : bool

Method Details

Download() public method

Downloads the template(s) at the specified URL and appends them to the body.
public Download ( string url, System.Action onComplete ) : void
url string The URL of the template(s) to download.
onComplete System.Action Callback to invoke upon completion
return void

Get() public method

Retrieves the specified Template singleton instance (downloading it if it has not already been pulled).
public Get ( string selector ) : Template
selector string The CSS selector for the script block containing the template HTML.
return Template

GetAsync() public method

Retrieves a Template singleton instance (downloading it if it has not already been pulled).
public GetAsync ( string url, string selector, TemplateCallback callback ) : void
url string The URL that contains the template.
selector string The CSS selector for the script block containing the template HTML.
callback TemplateCallback Callback to return the template in.
return void

IsAvailable() public method

Gets whether a template at the given selector is available to use (it exists within the page).
public IsAvailable ( string selector ) : bool
selector string
return bool

IsDownloaded() public method

Determines whether the specified URL has been downloaded.
public IsDownloaded ( string url ) : bool
url string The URL of the template(s) to check.
return bool