Class Index

Classes


Namespace gadgets.util

Provides general-purpose utility functions.
Defined in: gadgets.js.

Namespace Summary
Constructor Attributes Constructor Name and Description
 
Method Summary
Method Attributes Method Name and Description
<static>  
gadgets.util.escapeString(str)
Escapes the input using html entities to make it safer.
<static>  
gadgets.util.getFeatureParameters(feature)
Gets the feature parameters.
<static>  
gadgets.util.hasFeature(feature)
Returns whether the current feature is supported.
<inner>  
init(config)
Initializes feature parameters.
<inner>  
Parses URL parameters into an object.
<static>  
gadgets.util.registerOnLoadHandler(callback)
Registers an onload handler.
<static>  
gadgets.util.sanitizeHTML(text)
<inner>  
unescapeEntity(match, value)
Regular expression callback that returns strings from unicode code points.
<static>  
gadgets.util.unescapeString(str)
Reverses escapeString
Namespace Detail
gadgets.util
Method Detail
<static> {String} gadgets.util.escapeString(str)
Escapes the input using html entities to make it safer. Currently not in the spec -- future proposals may change how this is handled. TODO: Parsing the string would probably be more accurate and faster than a bunch of regular expressions.
Parameters:
{String} str
The string to escape
Returns:
{String} The escaped string

<static> {Object} gadgets.util.getFeatureParameters(feature)
Gets the feature parameters.
Parameters:
{String} feature
The feature to get parameters for
Returns:
{Object} The parameters for the given feature, or null

<static> {Boolean} gadgets.util.hasFeature(feature)
Returns whether the current feature is supported.
Parameters:
{String} feature
The feature to test for
Returns:
{Boolean} True if the feature is supported

<inner> init(config)
Initializes feature parameters.
Parameters:
config

<inner> {Array.<String>} parseUrlParams()
Parses URL parameters into an object.
Returns:
{Array.<String>} The parameters

<static> gadgets.util.registerOnLoadHandler(callback)
Registers an onload handler.
Parameters:
{Function} callback
The handler to run

<static> gadgets.util.sanitizeHTML(text)
Parameters:
text

<inner> {String} unescapeEntity(match, value)
Regular expression callback that returns strings from unicode code points.
Parameters:
{Array} match
Ignored
{String} value
The codepoint value to convert
Returns:
{String} The character corresponding to value.

<static> gadgets.util.unescapeString(str)
Reverses escapeString
Parameters:
{String} str
The string to unescape.

Documentation generated by JsDoc Toolkit 2.0.2 on Wed Nov 12 2008 12:35:37 GMT-0800 (PST)