BlockLocation Class
_controllers\_blocks\BlockLocation.js:1
BlockLocation resides inside a scene or timeline and manages internal playback of scenes and resources
Constructor
BlockLocation
-
i_placement
-
i_campaign_timeline_chanel_player_id
Parameters:
-
i_placement
Stringlocation where objects resides which can be scene or timeline
-
i_campaign_timeline_chanel_player_id
Stringrequired and set as block id when block is inserted onto timeline_channel
Returns:
Block instance
Item Index
Methods
- _addLocationItem
- _alphaPopulate
- _announceBlockChanged
- _bgPropsPopulate
- _bgPropsUnpopulate
- _borderPropsPopulate
- _borderPropsUnpopulate
- _deleteBlock
- _enableBgSelection
- _fabricAlpha
- _fabricateBorder
- _fabricateOptions
- _fabricColorPoints
- _fabricLock
- _fabricRect
- _findBackground
- _findBorder
- _findGradientPoints
- _getBlockPlayerData
- _getLocationPageNames
- _googleMap
- _initSubPanel
- _isSceneCyclic
- _jumpToLocation
- _listenAddPoint
- _listenAddResource
- _listenAlphaChange
- _listenBackgroundStateChange
- _listenBlockSelected
- _listenBorderColorChange
- _listenGradientChange
- _listenLiveInputs
- _listenLocationRowChanged
- _listenMenuControls
- _listenPriorityChange
- _listenRadiusChange
- _listenRemoveResource
- _listenVolumeChange
- _listenVolumeChange
- _loadBlockSpecificProps
- _onBlockLengthChanged
- _onBlockSelected
- _populate
- _populatePriority
- _populateRadius
- _populateTableDefault
- _populateTotalMapLocations
- _removeLocation
- _selfDestruct
- _setBlockPlayerData
- _setLocationBlockGlobalValidationOwner
- _toggleBackgroundColorHandler
- _toggleLock
- _updateBlockDimensions
- _updateBlockLength
- _updateTitle
- _viewSubPanel
- deleteBlock
- fabricateBlock
- getBlockData
- getZindex
- initialize
- m_blockAcronym
- setZindex
Methods
_addLocationItem
-
e
-
type
Add to our XML a list item item which can be of one of two types addDefault: a default resource to play when not within radius of GPS coords addLocation: a particular resource to play within specific GPS coords
Parameters:
-
e
Event -
type
StringaddDefault or addLocation
_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
Booleanif true only remove from existance but not from msdb
Returns:
none
_enableBgSelection
()
Enable gradient background UI
_fabricAlpha
-
i_domPlayerData
Fabricate alpha to canvas
Parameters:
-
i_domPlayerData
Object
_fabricateBorder
-
i_options
Config the fabric block border
Parameters:
-
i_options
I_options
Returns:
object literal
_fabricateOptions
-
i_top
-
i_left
-
i_width
-
i_height
-
i_angle
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 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
Fabricate color points to canvas
Parameters:
-
i_width
Number -
i_height
Number -
i_domPlayerData
Xml
Returns:
r fabric js rectangular
_findBackground
-
i_domPlayerData
Find the background section in player_data for selected block
Parameters:
-
i_domPlayerData
Object
Returns:
xSnippet
_findBorder
-
i_domPlayerData
Find the border section in player_data for selected block
Parameters:
-
i_domPlayerData
Object
Returns:
xSnippet
_findGradientPoints
-
i_domPlayerData
Find the gradient blocks in player_data for selected block
Parameters:
-
i_domPlayerData
Object
Returns:
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:
player data of block (aka player) parsed as DOM
_getLocationPageNames
()
Get all the location pages names for current location block this is called against the last block instance that registered the global function of setLocationBlockGlobalValidationOwner
_googleMap
-
i_markerOnClick
-
i_reloadData
-
i_loadStackView
Open google maps and load it with all current locations
Parameters:
-
i_markerOnClick
Booleanset to true if we are going to expect user to add a new location or false if we just want to open an existing map and not add any new locations
-
i_reloadData
Booleanreload the map with fresh data, used when we delete map items and want to force a refresh
-
i_loadStackView
Booleananimate the slider StackView into position
_initSubPanel
-
i_panel
Init the sub properties panel for a block
Parameters:
-
i_panel
String
_isSceneCyclic
-
i_playerData
Check if scene is pointing to itself to avoid cyclic reference
Parameters:
-
i_playerData
Number
Returns:
true if cyclic reference
_jumpToLocation
-
i_index
Select specific location and populate both the UI as well scroll map to coordinates
Parameters:
-
i_index
String
_listenAddPoint
-
i_playerData
Listen to adding a new point from google maps, and if we pending for addition, take action
Parameters:
-
i_playerData
Number
Returns:
Unique clientId.
_listenAddResource
()
Listen to add new resource and when clicked, wait for announcement from AddBlockListView that a new resource or scene needs to be added to either the default play list (aka Fixed) or to the Location based play list (aka GPS)
_listenAlphaChange
()
Listen to changes in Alpha UI properties selection and update msdb
_listenBackgroundStateChange
()
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
()
Update a block's player_data with new gradient background
_listenLiveInputs
()
Listen to changes in LiveInputs including resource names, long and lat values
_listenLocationRowChanged
()
Listen to when location row was edited
_listenMenuControls
()
Listen to location controls, add remove, next, add ...
_listenPriorityChange
()
Listen to changes in priority
_listenRadiusChange
()
Listen to changes in radius per selected location
_listenRemoveResource
()
Listen to when removing a resource from location list
The algorithm will uses our bootstrap-table own inject rowIndex value
and counts up to match with the order of
_listenVolumeChange
()
Listen to changes in volume control
_listenVolumeChange
()
Listen to changes in row due to drag
_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
()
The main functions which renders and loads up the entire property panel with both default resource list as well as map location coordinates list
Returns:
none
_populatePriority
-
i_value
Populate the priority widget
Parameters:
-
i_value
Number
_populateRadius
-
i_value
Populate the radius UI element
Parameters:
-
i_value
Object
_populateTableDefault
-
i_domPlayerData
Load list into the UI for default content
Parameters:
-
i_domPlayerData
Object
_populateTotalMapLocations
-
domPlayerData
Populate the total map locations set
Parameters:
-
domPlayerData
Object
_removeLocation
()
Remove current selected location
_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
Objectthe dom object to save to local msdb
-
[i_noNotify]
String optionalif set, fire event announcing data saved
-
[i_xmlIsString]
Boolean optionalif set, bypass serializeToString since already in string format
_setLocationBlockGlobalValidationOwner
()
re-take ownership for a caller block instance and register global Validators for bootstrap-table to format data This function has to run everytime we populate the UI since it is a shared global function and we have to override it so 'this' refers to correct BlockLocation instance
_toggleBackgroundColorHandler
-
e
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
_viewSubPanel
-
i_panel
Bring into view a sub properties panel of this block
Parameters:
-
i_panel
String
deleteBlock
-
i_memoryOnly
Delete this block
Parameters:
-
i_memoryOnly
Booleanif true only remove from existance but not from msdb
fabricateBlock
()
Convert the block into a fabric js compatible object, called externally on creation of block
getBlockData
()
Object
Get block data as a json formatted object literal and return to caller
Returns:
data The entire block data members which can be made public
getZindex
-
i_index
Get a block's z-index
Parameters:
-
i_index
Number
initialize
()
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
Stringblock_id
Block.BLOCK_SELECTED
event fires when block is selected
Event Payload:
-
caller
This -
selected
Stringblock_id
Block.SCENE_BLOCK_CHANGE
event fires when scene block was changed so scene needs to be re-rendered
Event Payload:
-
caller
This -
selected
Stringblock_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
Stringblock_id