Module: farbs

farbs

The farbs object.

Version:
  • 0.4
Source:
  • farbs.js, line 18

Members

<static> attributeName

The attribute name farbs uses for type detection and property mixin.

Source:
  • farbs.js, line 28

<static> classRegistry

The class registry. Use this to get access to classes.

Source:
  • farbs.js, line 35

<static> instRegistry

The instance registry. Use this to get access to instances of, e.g. UI widgets.

Source:
  • farbs.js, line 42

<static> listeners

Holds listeners for pub/sub mechanism.

Source:
  • farbs.js, line 54

<static> methodRegistry

The method registry. Use this to get access to methods.

Source:
  • farbs.js, line 49

<static> version

The version of this farbs object.

Source:
  • farbs.js, line 23

Methods

<static> parse(parentNode)

Parses a DOM (Sub-)Tree and instantiates classes for nodes containing a data-farbs_type attribute. Will register instances in farbs.instRegistry.

Parameters:
Name Type Argument Description
parentNode HTMLElement <optional>
The node in the tree to begin parsing at. Optional.
Source:
  • farbs.js, line 137

<static> publish(topic, data)

Publishes a topic to registered listeners

Parameters:
Name Type Argument Description
topic string The topic
data * <optional>
The data to pass to listeners
Source:
  • farbs.js, line 92

<static> registerClass(id, ctor)

Registers a class for later use.

Parameters:
Name Type Description
id string The id (== class name) to register the class with
ctor Object The class to register
Source:
  • farbs.js, line 62

<static> registerInstance(id, inst)

Registers an instance of a class.

Parameters:
Name Type Description
id string The id to register the instance with
inst Object The instance to register
Source:
  • farbs.js, line 72

<static> registerMethod(id, func)

Registers a method.

Parameters:
Name Type Description
id string The id of the method to register
func Function The method to register
Source:
  • farbs.js, line 82

<static> subscribe(topic, callback)

Subscribes a listener to a topic.

Parameters:
Name Type Description
topic string The topic
callback Function The listener
Source:
  • farbs.js, line 107

<static> unsubscribe(topic, callback)

Unsubscribes a listener from a topic.

Parameters:
Name Type Description
topic string The topic
callback Function The listener
Source:
  • farbs.js, line 118