API Docs for: 0.0.2
Show:

core.EventBroadcaster Class

Singleton.
Allows a global object to be utilized for broadcasting events.

Example:

EventBroadcaster.instance().on("eventName", scope._("someEvent"), scope);

Constructor

core.EventBroadcaster

(
  • opts
)

Parameters:

  • opts Object

    An object containing configurations required by the Core derived class.

Methods

clearProxyHandler

(
  • method
)

Inherited from core.Core: src/core.js:716

Core method for clearing proxied function methods.

Parameters:

  • method String

    The string equivalent of the defined method to clear.

construct

(
  • options
)

Inherited from core.Core: src/core.js:732

Core method initialization. This is called automatically on core sub classes.

Parameters:

  • options Object

    The object passed on the constructor of a core based class.

containsScope

(
  • list
  • scope
)
Booleans private

Checks the array of listeners for existing scopes.

Parameters:

  • list Array

    Reference to the array of subscribed listeners

  • scope Object

    Reference to the scope being queried for existence

Returns:

Booleans:

Returns boolean indicating the existence of the scope passed on the parameters

delayedConstruct

(
  • options
)

Inherited from core.Core: src/core.js:740

Core method initialization. This is called automatically on core sub classes. Adds delay when being called automatically, this allows time to setup all the other classes and manage the sequence of instantiations.

Parameters:

  • options Object

    The object passed on the constructor of a core based class.

dispose

(
  • removeNode
)

Inherited from core.Core: src/core.js:749

Core method for destroying/cleaning up objects.

Parameters:

  • removeNode Boolean

    If true and there is a node attached in the class (el property) that element is going to be removed upon disposal.

find

(
  • selector
)
NodeList

Inherited from core.Core: src/core.js:770

Core method for searching sub node elements.

Parameters:

  • selector String

    The selector used for searching sub nodes.

Returns:

NodeList:

An array of HTMLElements, please note that this is not jQuery selected nodes.

findAll

(
  • selector
)
NodeList

Inherited from core.Core: src/core.js:785

Core method for searching sub node elements within the document context.

Parameters:

  • selector String

    The selector used for searching sub nodes within the document.

Returns:

NodeList:

An array of HTMLElements, please note that this is not jQuery selected nodes.

getProxyHandler

(
  • method
)
Function

Inherited from core.Core: src/core.js:695

Returns a scope bound function and stores it on the proxyHandlers property.

Parameters:

  • method String

    The string equivalent of the defined method name of the class.

Returns:

Function:

The scope bound function defined on the parameter.

off

(
  • eventName
  • method
  • scope
)

Unsubscribe function. Called when removing a subscriber from the broadcasting object.

Parameters:

  • eventName String

    The event name unsubscribing from.

  • method Function

    The method handler to trigger when the event specified is dispatched.

  • scope core.Core

    Reference to the scope of the event handler

on

(
  • eventName
  • method
  • scope
)

Subscribe function. Called when adding a subscriber to the broadcasting object.

Parameters:

  • eventName String

    The event name being subscribed to

  • method Function

    The method handler to trigger when the event specified is dispatched.

  • scope core.Core

    Reference to the scope of the event handler

once

(
  • eventName
  • method
  • scope
)

Subscribe once function. Called when adding a subscriber to the broadcasting object.

Parameters:

  • eventName String

    The event name being subscribed to

  • method Function

    The method handler to trigger when the event specified is dispatched.

  • scope core.Core

    Reference to the scope of the event handler

register

(
  • eventName
  • scope
  • method
  • once
)
private

Private method handler for event registration.

Parameters:

  • eventName String

    The event name being added on the listener list.

  • scope Object

    Reference to the scope of the event handler

  • method Function

    The method used by the scope to handle the event being broadcasted

  • once Boolean

    Specify whether the event should only be handled once by the scope and its event handler

removeAll

()

Removes all items from the listener list.

removeScope

(
  • scope
)

Unsubscribe function - scope context. Unsubscribes a specific scope from ALL events

Parameters:

  • scope core.Core

    Reference to the scope subscriber being removed.

trigger

(
  • eventName
  • variables
)

Broadcast functions. Triggers a broadcast on the EventDispatcher/derived object.

Parameters:

  • eventName String

    The event name to trigger/broadcast.

  • variables Object

    An object to send upon broadcast

unregister

(
  • eventName
  • scope
  • method
  • once
)
private

Private method handler for unregistering events

Parameters:

  • eventName String

    The event name being added on the listener list.

  • scope Object

    Reference to the scope of the event handler

  • method Function

    The method used by the scope to handle the event being broadcasted

  • once Boolean

    Specify whether the event should only be handled once by the scope and its event handler

Properties

node

HTMLElement

Inherited from core.Core: src/core.js:641

The selected HTML element node reference.

proxyHandlers

Object

Inherited from core.Core: src/core.js:658

Property for storing proxied function/methods