APIs

Show:

Image block resides inside a scene or timeline

Constructor

BlockSVG

(
  • i_placement
  • i_campaign_timeline_chanel_player_id
)
Object

Parameters:

  • i_placement String

    location where objects resides which can be scene or timeline

  • i_campaign_timeline_chanel_player_id String

    required and set as block id when block is inserted onto timeline_channel

Returns:

Object:

Block instance

Item Index

Methods

Methods

_alphaPopulate

()

On changes in msdb model updated UI common alpha properties

_announceBlockChanged

(
  • i_player_data
)

Announce that this block has changed

Parameters:

  • i_player_data Number

_bgPropsPopulate

()

On changes in msdb model updated UI common gradient background properties

_bgPropsUnpopulate

()

Disable the gradient background UI

_borderPropsPopulate

()

On changes in msdb model updated UI common border properties

_borderPropsUnpopulate

()

Disable the border UI

_deleteBlock

(
  • i_memoryOnly
)

Delete block is a private method that is always called regardless if instance has been inherited or not. Used for releasing memory for garbage collector.

Parameters:

  • i_memoryOnly Boolean

    if true only remove from existance but not from msdb

Returns:

none

_enableBgSelection

()

Inherited from Block but overwritten in _controllers\_blocks\Block.js:198

Enable gradient background UI

_fabricAlpha

(
  • i_domPlayerData
)

Fabricate alpha to canvas

Parameters:

  • i_domPlayerData Object

_fabricateBorder

(
  • i_options
)
Object

Config the fabric block border

Parameters:

  • i_options I_options

Returns:

Object:

object literal

_fabricateOptions

(
  • i_top
  • i_left
  • i_width
  • i_height
  • i_angle
)
Object

Build the options injected into a newly created fabric object

Parameters:

  • i_top Number
  • i_left Number
  • i_width Number
  • i_height Number
  • i_angle Number

Returns:

Object:

object literal

_fabricColorPoints

(
  • i_domPlayerData
)

Fabricate color points to canvas

Parameters:

  • i_domPlayerData Xml

_fabricLock

()

On changes in msdb model updated UI common lock properties

_fabricRect

(
  • i_width
  • i_height
  • i_domPlayerData
)
Object

Fabricate color points to canvas

Parameters:

  • i_width Number
  • i_height Number
  • i_domPlayerData Xml

Returns:

Object:

r fabric js rectangular

_findBackground

(
  • i_domPlayerData
)
Xml

Find the background section in player_data for selected block

Parameters:

  • i_domPlayerData Object

Returns:

Xml:

xSnippet

_findBorder

(
  • i_domPlayerData
)
Xml

Find the border section in player_data for selected block

Parameters:

  • i_domPlayerData Object

Returns:

Xml:

xSnippet

_findGradientPoints

(
  • i_domPlayerData
)
Xml

Find the gradient blocks in player_data for selected block

Parameters:

  • i_domPlayerData Object

Returns:

Xml:

xSnippet

_getBlockPlayerData

() Object

Get the XML player data of a block, depending where its placed If you like to view XML raw data, be sure to debug domPlayerData.children[0].outerHTML

Returns:

Object:

player data of block (aka player) parsed as DOM

_initResourcesData

()

Set the instance resource data from msdb which includes resource_id (handle of a resource) as well as the description of the resource and icon.

_initSubPanel

(
  • i_panel
)

Init the sub properties panel for a block

Parameters:

  • i_panel String

_listenAlphaChange

()

Listen to changes in Alpha UI properties selection and update msdb

_listenBackgroundStateChange

()

Inherited from Block but overwritten in _controllers\_blocks\Block.js:360

Listen to change in background enable / disable states

_listenBlockSelected

()

Notify this object that it has been selected so it can populate it's own the properties box etc The function triggers from the BLOCK_SELECTED event.

Returns:

none

_listenBorderColorChange

()

Update a block's player_data with new border background

_listenGradientChange

()

Inherited from Block but overwritten in _controllers\_blocks\Block.js:382

Update a block's player_data with new gradient background

_listenInputChange

()

When user changes a URL link for the feed, update the msdb

Returns:

none

_loadBlockSpecificProps

()

Populate the common block properties panel, called from base class if exists

Returns:

none

_onBlockLengthChanged

()

Take action when block length has changed which is triggered by the BLOCK_LENGTH_CHANGING event

Returns:

none

_onBlockSelected

()

When a block is selected, find out where is it placed (scene/ channel) and change props accordingly

_populate

()

Load up property values in the common panel

Returns:

none

_selfDestruct

()

bug fix: backward comparability with player_data that includes deleted resources this was already fixed but we live _selfDestruct for backwards compatability

_setBlockPlayerData

(
  • i_xmlDoc
  • [i_noNotify]
  • [i_xmlIsString]
)

Update the msdb for the block with new values inside its player_data

Parameters:

  • i_xmlDoc Object

    the dom object to save to local msdb

  • [i_noNotify] String optional

    if set, fire event announcing data saved

  • [i_xmlIsString] Boolean optional

    if set, bypass serializeToString since already in string format

_toggleBackgroundColorHandler

(
  • e
)

Inherited from Block but overwritten in _controllers\_blocks\Block.js:288

Toggle block background on UI checkbox selection

Parameters:

  • e Event

_toggleLock

()

Toggle lock status

_updateBlockDimensions

()

Update the position of the block when placed inside a scene

_updateBlockLength

()

Update the length properties of the block with respect to position on the timeline_channel

Returns:

none

_updateTitle

()

Update the title of the block inside the assigned element.

Returns:

none

_updateTitle override

()

Update common property title element

Returns:

none

_viewSubPanel

(
  • i_panel
)

Bring into view a sub properties panel of this block

Parameters:

  • i_panel String

deleteBlock

(
  • i_memoryOnly
)

Inherited from Block but overwritten in _controllers\_blocks\BlockSVG.js:233

Delete this block

Parameters:

  • i_memoryOnly Boolean

    if true only remove from existance but not from msdb

fabricateBlock

()

Inherited from Block but overwritten in _controllers\_blocks\BlockSVG.js:103

Convert the block into a fabric js compatible object, called externally on creation of block

fabricateBlock!~YUIDOC_LINE~!!~YUIDOC_LINE~! fabricateBlock: function (i_canvasScale, i_callback) else {!~YUIDOC_LINE~! imgPath = window.g_protocol + pepper.getUserData().domain + '/Resources/business' + pepper.getUserData().businessID + '/resources/' + self.m_nativeID + '.' + self.m_fileFormat;!~YUIDOC_LINE~! }!~YUIDOC_LINE~!!~YUIDOC_LINE~! $('<img src="' + imgPath + '" style="display: none" >').load(function () {!~YUIDOC_LINE~! $(this).width(1000).height(800).appendTo('body');!~YUIDOC_LINE~! var options = self._fabricateOptions(parseInt(layout.attr('y')), parseInt(layout.attr('x')), parseInt(layout.attr('width')), parseInt(layout.attr('height')), parseInt(layout.attr('rotation')));!~YUIDOC_LINE~! var img = new fabric.Image(this, options);!~YUIDOC_LINE~! _.extend(self, img);!~YUIDOC_LINE~! self._fabricAlpha(domPlayerData);!~YUIDOC_LINE~! self._fabricLock();!~YUIDOC_LINE~! self['canvasScale'] = i_canvasScale;!~YUIDOC_LINE~! i_callback();!~YUIDOC_LINE~! })!~YUIDOC_LINE~! },

()

Convert the block into a fabric js compatible object

getBlockData

() Object

Get block data as a json formatted object literal and return to caller

Returns:

Object:

data The entire block data members which can be made public

getResourceID

() Number

Get the resource id of the embedded resource

Returns:

Number:

resource_id;

getZindex

(
  • i_index
)

Get a block's z-index

Parameters:

  • i_index Number

initialize

()

Inherited from Block but overwritten in _controllers\_blocks\BlockSVG.js:14

Constructor

m_blockAcronym

()

Update the title of the selected tab properties element

setZindex

(
  • i_index
)

Set a block's z-index in case we know it (i.e.: it is going to be a re-render of a previous block that was removed from the canvas)

Parameters:

  • i_index Number

Events

Block.BLOCK_BORDER_CHANGE

event fires when block border changed so scene needs to be re-rendered

Event Payload:

  • caller This
  • selected String

    block_id

Block.BLOCK_SELECTED

event fires when block is selected

Event Payload:

  • caller This
  • selected String

    block_id

Block.SCENE_BLOCK_CHANGE

event fires when scene block was changed so scene needs to be re-rendered

Event Payload:

  • caller This
  • selected String

    block_id

Block.SCENE_BLOCKS_RENDERED

event fires when scene blocks freshly re-rendered onto the scene canvas so we need to update the UI of ALL blocks normally occurs after a Block.SCENE_BLOCK_CHANGE event

Event Payload:

  • caller This
  • selected String

    block_id