API Docs for: 0.0.1
Show:

HTMLElement Class

Module: node-plugin

Methods

bindModel

(
  • model
  • [mergeCurrent=false]
)

Defined in src/node-plugin/node-plugin.js:335

Available since 0.0.1

Binds a model to the plugin, making plugin.model equals the bound model. Immediately syncs the plugin with the new model-data.

Syncs the new vnode's childNodes with the dom.

Parameters:

  • model Object

    the model to bind to the itag-element

  • [mergeCurrent=false] Boolean optional

    when set true, current properties on the plugin's model that aren't defined in the new model, get merged into the new model.

definePlugin

(
  • plugin
  • [constructor]
  • [prototypes]
)
PluginClass

Defined in src/node-plugin/node-plugin.js:549

Available since 0.0.1

Creates a new Element-PluginClass.

Parameters:

  • plugin String

    the namespace of the plugin

  • [constructor] Function optional

    The function that will serve as constructor for the new class. If undefined defaults to NOOP

  • [prototypes] Object optional

    Hash map of properties to be added to the prototype of the new class.

Returns:

PluginClass:

defineWhenUndefined

(
  • key
  • value
)
chainable

Defined in src/node-plugin/node-plugin.js:413

Available since 0.0.1

Defines the key-property on element.model, but only when is hasn't been defined before.

Parameters:

  • key String

    plugin.model's property

  • value Any

    its value to be set

getPlugin

(
  • plugin
)
Promise

Defined in src/node-plugin/node-plugin.js:261

Available since 0.0.1

Gets the plugin-instance of the specified plugin-name. Will fulfill as soon as the plugin is ready.

Parameters:

  • plugin String

    The name of the plugin that should be plugged.

Returns:

Promise:

the plugin-instance of the specified plugin-name

getPluginClass

(
  • plugin
)
PluginClass | Indefined

Defined in src/node-plugin/node-plugin.js:579

Available since 0.0.1

Returns the PluginClass that belongs with the specified plugin-name.

Parameters:

  • plugin String

    the namespace of the plugin

Returns:

PluginClass | Indefined:

isPlugged

(
  • plugin
)
Boolean

Defined in src/node-plugin/node-plugin.js:200

Available since 0.0.1

Checks whether the plugin is plugged in at the HtmlElement. Checks whether all its attributes are set.

Parameters:

  • plugin String

    The name of the plugin that should be plugged. Needs to be the Class, not an instance!

Returns:

Boolean:

whether the plugin is plugged in

plug

(
  • plugin
  • [config]
  • [model]
)
Object | Undefined

Defined in src/node-plugin/node-plugin.js:229

Available since 0.0.1

Plugs in the plugin on the HtmlElement, and gives is special behaviour by setting the appropriate attributes.

Parameters:

  • plugin String

    The name of the plugin that should be plugged.

  • [config] Object optional

    any config that should be passed through when the class is instantiated.

  • [model] Object optional

    model to used as ns.model

Returns:

Object | Undefined:

the plugin's instance, or undefined in case of an unregistered plugin

pluginReady

(
  • plugin
)
Promise

Defined in src/node-plugin/node-plugin.js:214

Available since 0.0.1

Checks whether the plugin is ready to be used.

Parameters:

  • plugin String

    The name of the plugin that should be ready.

Returns:

Promise:

whether the plugin is plugged in

subClass

(
  • plugin
  • [constructor]
  • [prototypes]
  • [chainConstruct=true]
)
Plugin | Undefined

Returns a newly created class inheriting from this class using the given constructor with the prototypes listed in prototypes merged in.

The newly created class has the $$super static property available to access all of is ancestor's instance methods.

Further methods can be added via the mergePrototypes.

Parameters:

  • plugin String

    the namespace of the plugin

  • [constructor] Function optional

    The function that will serve as constructor for the new class. If undefined defaults to NOOP

  • [prototypes] Object optional

    Hash map of properties to be added to the prototype of the new class.

  • [chainConstruct=true] Boolean optional

    Whether -during instance creation- to automaticly construct in the complete hierarchy with the given constructor arguments.

Returns:

Plugin | Undefined:

undefined when no valid namespace is given

Example:

var Circle = Shape.subClass( function (x, y, r) { // arguments will automaticly be passed through to Shape's constructor this.r = r; }, { area: function () { return this.r this.r Math.PI; } } );

unplug

(
  • PluginClass
)
chainable

Defined in src/node-plugin/node-plugin.js:278

Available since 0.0.1

Unplugs a NodePlugin from the HtmlElement.

Parameters:

  • PluginClass NodePlugin

    The plugin that should be unplugged. Needs to be the Class, not an instance!