Table of Contents
This section documents the various JavaScript components that are available to widget developers.
This components contains a number of useful helper functions core to the operation of Recite CMS widgets. There are additional utility methods that can be used in Recite_Util.
<static>
{String}
Recite.GetUrl(target)
Get a real Recite CMS URL based on a string in module:controller:action syntax
var url = Recite.GetUrl('assets:asset:upload');
Parameters:
String target
- The URL in module:controller:action syntax
Returns:
String The real URL that can be used for links or Ajax requests
<static>
{Bool}
Recite.HasCss(path)
Check if the CSS file with the given path has been loaded
if (Recite.HasCss('/path/to/styles.css')) { ... }
Parameters:
String path
- The path of the CSS script to check for
Returns:
Bool Returns true if the CSS file has previously been loaded, false if not.
<static>
Recite.LoadCss(path)
Loads a CSS file. If the file has already been loaded it will not be loaded again.
Recite.LoadCss('path/to/styles.css');
Parameters:
String path
- The path of the CSS file to load
Returns: Void
<static>
Recite.LoadScript(path, fn)
Load a JavaScript script based on the specified path. If the script has already dynamically been loaded with this function it will not be loaded again but the callback function will be called again.
Recite.LoadScript('/path/to/script.js, function() { alert('script is loaded!'); });
Parameters:
String path
- The path to the script to load
Function fn
- Optional
- The function to call when the script has loaded. Accepts no arguments
Returns: Void