Skip to content

Latest commit

 

History

History
116 lines (94 loc) · 3.31 KB

PUBLIC_FUNCTIONS.md

File metadata and controls

116 lines (94 loc) · 3.31 KB

Observe.js - Functions:

Below is a list of all the public functions that can be called from the Observe.js instance.

Watching Objects:

watch( object, options ):

Adds an object that should be watched for changes.
Parameter: object: 'Object' - The object that should be watched.
Parameter: options: 'Object' - All the options that should be used (refer to "Configuration Options" documentation for properties).
Returns: 'string' - The ID that the object watch is stored under.

cancelWatch( id ):

Cancels the watching of an object for changes.
Parameter: id: 'string' - The ID of the object being watched, or DOM element ID being watched.
Returns: 'boolean' - States if the object being watched has been cancelled.

cancelWatches():

Cancels all the watches currently running, or paused.
Returns: 'Object' - The Observe.js class instance.

getWatch( id ):

Returns the properties for a running, or paused, watch.
Parameter: id: 'string' - The ID of the object being watched, or DOM element ID being watched.
Returns: 'Object' - The watch properties for an object (null if not found).

getWatches():

Returns all the watches currently running, or paused.
Returns: 'Object' - The object of watches currently running, or paused.

pauseWatch( id, milliseconds ):

Pauses the watching of an object for changes for a specific number of milliseconds.
Parameter: id: 'string' - The ID of the object being watched, or DOM element ID being watched.
Parameter: milliseconds: 'number' - The milliseconds to pause the watch for.
Returns: 'boolean' - States if the object being watched has been paused.

pauseWatches( milliseconds ):

Pauses all the watches for a specific number of milliseconds.
Parameter: milliseconds: 'number' - The milliseconds to pause the watches for.
Returns: 'Object' - The Observe.js class instance.

resumeWatch( id ):

Resumes all the watches that are currently paused.
Parameter: id: 'string' - The ID of the object being watched, or DOM element ID being watched.
Returns: 'boolean' - States if the watching of an object has been resumed.

resumeWatches():

Resumes the watching of all objects for changes after they were paused.
Returns: 'Object' - The Observe.js class instance.

searchDomForNewWatches():

Searches the DOM for new elements to watch, and adds them.
Returns: 'Object' - The Observe.js class instance.

Configuration:

setConfiguration( newConfiguration ):

Sets the specific configuration options that should be used.
Parameter: newConfiguration: 'Object' - All the configuration options that should be set (refer to "Configuration Options" documentation for properties).
Returns: 'Object' - The Observe.js class instance.

Additional Data:

getVersion():

Returns the version of Observe.js.
Returns: 'string' - The version number.

Example:

<script> 
    var version = $observe.getVersion();
</script>