Class adways.content.Content

Extends: adways.hv.Bridged

A Content represents a part of en enrichment. Generaly, an enrichment has only one content, but it can have more. See adways.content.DisplayableEnrichment

adways.content.Content( ) private

<Number> addEventListener( kind, callback, [instance=null], [priority=0], [useWeakReference=false] ) public
Adds an event listener of a specific event kind.

Parameters:

  • kind <Constant>
    kind of the event to listen
  • callback <FUNCTION>
    function called when the event is fired
  • [instance=null] <Object> optional
    callback's instance. Useful when the callback is binded to an object:
                        Class = function () {};
                        Class.prototype.callback = function () {};
                        var a = new Class();
                        aDispatcher.addEventListener(AN_EVENT_KIND, a.callback, a);
  • [priority=0] <Number> optional
    priority
  • [useWeakReference=false] <Boolean> optional
    not yet used
Return: <Number>: 1 if event added, 0 otherwise (already added callback). When instance==null, the callback should be accessible from the global context and be a "static" method. Exemple:
                    namespaceA.subnamespace.myCallback = function (event) {
                        ...
                    };
                    aDispatcher.addEventListener(AN_EVENT_KIND, namespaceA.subnamespace.myCallback);
blur( ) public

Indicates the engine to blur the content div.

connect( ) public

Inherited from adways.hv.Bridged:

Connect bridged element

executeUserActions( ) public

Indicates the engine to execute the content user actions.

focus( ) public

Indicates the engine to focus the content div.

<Object> getCustomData( key ) public

Get a custom data entry

Parameters:

  • key <String>

    "String" key entry.

Return: <Object>:

Custom data entry (object that can be jsonified).

<adways.type.evt.BooleanR> getRequireUserInput( ) public

Returns 1 if the content needs a front div to catch the user inputs, 0 otherwise.

Return: <adways.type.evt.BooleanR>:

?.

<Number> hasEventListener( kind, callback, [instance=null] ) public
Whether or not a listener has already been added.

Parameters:

  • kind <Constant>
    the event's kind
  • callback <FUNCTION>
    the listener's function
  • [instance=null] <Object> optional
    the listener callback's instance
Return: <Number>: the listeners count.
isConnected( ) public

Inherited from adways.hv.Bridged:

Connect bridged element

<Number> nbEventListeners( kind ) public
Counts the listeners added for a specific event.

Parameters:

  • kind <Constant>
    the event's kind
Return: <Number>: the listeners count.
<Number> removeAllEventListeners( ) public
Removes all the listeners.
Return: <Number>: 1 on success (currently always), 0 otherwise.
<Number> removeEventListener( kind, callback, [instance=null] ) public
Removes an event listener of a specific event kind.

Parameters:

  • kind <Constant>
    kind of the event to listen
  • callback <FUNCTION>
    function called when the event is fired
  • [instance=null] <Object> optional
    callback's instance
Return: <Number>: 1 if event removed, 0 otherwise ( couple < instance + callback > not found).
sendStat( key, value ) public

Send a custom stat data

Parameters:

  • key <String>

    "String" key entry.

  • value <String>

    "String" value entry.

<Number> setCustomData( key, value ) public

Set a custom data entry

Parameters:

  • key <String>

    "String" key entry.

  • value <Object>

    Object that can be jsonified.

Return: <Number>:

1 if the value is changed, 2 if new value is set, 0 if error.