C# Class Open.Core.Helpers.ScriptLoadHelper

Utility methods for loading scripts.
Inheritance: ModelBase
Exibir arquivo Open project: philcockfield/Open.TestHarness.SL

Public Methods

Method Description
IsDeclared ( string url ) : bool

Determines whether a SCRIPT block with the specified url exists in the DOM.

IsLibraryLoaded ( ScriptLibrary library ) : bool

Determines whether the specified library has been loaded.

IsLoaded ( string url ) : bool

Determines whether the specified URL has been loaded (either via one of the Load methods, or is decalred within the page).

Load ( string url, AjaxCallback callback ) : void

Loads the specified SCRIPT file. This passes execution to 'jQuery.GetScript' but keep track of the URL as being loaded so future checks to IsLoaded will report the script is in existence on the client.

LoadLibrary ( ScriptLibrary library, System.Action callback ) : void

Loads the specified library.

Private Methods

Method Description
CacheUrl ( string url ) : void
FileName ( string name, bool hasDebug ) : string
Url ( string path, string fileName, bool debugVersion ) : string

Retrieves the URL of a script.

Method Details

IsDeclared() public method

Determines whether a SCRIPT block with the specified url exists in the DOM.
public IsDeclared ( string url ) : bool
url string The URL of the script block to look for.
return bool

IsLibraryLoaded() public method

Determines whether the specified library has been loaded.
public IsLibraryLoaded ( ScriptLibrary library ) : bool
library ScriptLibrary The library to look for.
return bool

IsLoaded() public method

Determines whether the specified URL has been loaded (either via one of the Load methods, or is decalred within the page).
public IsLoaded ( string url ) : bool
url string The URL to look for.
return bool

Load() public method

Loads the specified SCRIPT file. This passes execution to 'jQuery.GetScript' but keep track of the URL as being loaded so future checks to IsLoaded will report the script is in existence on the client.
public Load ( string url, AjaxCallback callback ) : void
url string The URL of the SCRIPT file to load.
callback AjaxCallback Callback to invoke upon completion.
return void

LoadLibrary() public method

Loads the specified library.
public LoadLibrary ( ScriptLibrary library, System.Action callback ) : void
library ScriptLibrary Flag indicating the library to load.
callback System.Action Callback to invoke upon completion.
return void