API Docs for: 2.1.0
Show:

Tc.Application Class

Defined in: dist/terrific.js:131
Module: Tc

Responsible for application-wide issues such as the creation of modules and establishing connections between them.

Methods

end

(
  • hook
)

Registers a hook that is called at the end.

Parameters:

  • hook Function

    The hook function to be executed

init

(
  • $ctx
  • config
)

Initializes the application.

Parameters:

  • $ctx JQuery

    The jQuery context

  • config Object

    The configuration

registerConnection

(
  • connector
  • component
)

Registers a connection between a module and a connector.

Parameters:

  • connector String

    The full connector name (e.g. MasterSlave-Navigation)

  • component Module

    The module instance

registerModule

(
  • $node
  • modName
  • skins
  • connectors
)
Module

Registers a module.

Parameters:

  • $node JQuery

    The module node

  • modName String

    The module name. It must match the class name of the module

  • skins Array

    A list of skin names. Each entry must match a class name of a skin

  • connectors Array

    A list of connectors identifiers (e.g. MasterSlave-Navigation) Schema: {connectorName}-{connectorId}

Returns:

Module:

The reference to the registered module

registerModules

(
  • $ctx
)
Array

Register modules withing scope Automatically registers all modules within the scope, as long as the modules use the OOCSS naming conventions.

Parameters:

  • $ctx JQuery

    The jQuery context

Returns:

Array:

A list containing the references of the registered modules

start

(
  • modules
)

Starts (intializes) the registered modules.

Parameters:

  • modules Array

    A list of the modules to start

stop

(
  • modules
)

Stops the registered modules.

Parameters:

  • modules Array

    A list containing the module instances to stop

unregisterConnection

(
  • connectorId
  • component
)

Unregisters a module from a connector.

Parameters:

  • connectorId String

    The connector channel id (e.g. 2)

  • component Module

    The module instance

unregisterModules

(
  • modules
)

Unregisters the modules given by the module instances.

Parameters:

  • modules Array

    A list containing the module instances to unregister

Properties

$ctx

JQuery

The jQuery context.

config

Object

The configuration.

connectors

Object

Contains references to all connectors on the page.

modules

Array

Contains references to all modules on the page. This can, for example, be useful when there are interactions between Flash objects and Javascript.

sandbox

Sandbox

The sandbox to get the resources from This sandbox is shared between all modules.