CampaignView Class
_views\CampaignView.js:1
CampaignView module manages campaign related logic and UI
Constructor
CampaignView
()
Object
Returns:
instantiated CampaignView
Item Index
Methods
- _deleteTimeline
- _listenAddNewTimeline
- _listenBackToCampaigns
- _listenCampaignExpandedView
- _listenCampaignPreview
- _listenCampaignSelected
- _listenCampaignTimelinePreview
- _listenDelTimeline
- _listenScreenTemplateEdit
- _listenSelectNextChannel
- _listenTimelineLengthChanged
- _listenTimelineViewSelected
- _listenToggleTimelinesCollapsible
- _loadSequencerFirstTimeline
- _loadTimelinesFromDB
- _render
- _restart
- _updatedTimelinesLengthUI
- duplicateTimeline
- getSelectedCampaign
- getSelectedTimeline
- getTimelineInstance
- getTimelineViewStack
- initialize
- populateTimelines
Events
- CAMPAIGN_EXPANDED_VIEW static
- CAMPAIGN_SELECTED static
- CAMPAIGN_TIMELINE_CHANGED static
Methods
_deleteTimeline
-
e
-
i_caller
When a timeline is deleted, remove it from the local timelines hash and notify sequencer.
Parameters:
-
e
Event -
i_caller
Object
Returns:
none
_listenAddNewTimeline
()
Wire the UI for adding a new timeline
_listenBackToCampaigns
()
Go back to campaign selection screen
_listenCampaignExpandedView
()
Listen to when we should expand the view of all collapsible bootstrap widgets in our campaign view moduke
_listenCampaignPreview
()
Wire the UI for launching campaign preview
_listenCampaignSelected
()
Listen to campaign selection
_listenCampaignTimelinePreview
()
Wire the UI for launching specific timeline preview
_listenDelTimeline
()
Wire the UI for timeline deletion.
Returns:
none
_listenScreenTemplateEdit
()
Listen screen template edit button
_listenSelectNextChannel
()
Listen to select next channel clicj
_listenTimelineLengthChanged
()
Listen for updates on changes in length of currently selected timeline through the pepper framework
_listenTimelineViewSelected
()
This is a key method that we use to listen to fire event of ScreenLayoutSelectorView.ON_VIEWER_SELECTED. Upon the event we examine e.context.m_owner to find out who was the owner if the fired event (i.e.: instanceof) so we can select tha appropriate campaign or timeline in the UI. See further notes in code.
Returns:
none
_listenToggleTimelinesCollapsible
()
Toggle the arrow of the collapsible timelines / sequencer UI widget
_loadSequencerFirstTimeline
()
Select the first timeline in the sequencer UI and if fails, select main Campaign > timeline.
Returns:
none
_loadTimelinesFromDB
()
Load all of the campaign's timelines from msdb and populate the sequencer.
Returns:
none
_render
()
If loading an existing campaign (i.e.: we are not creating a brand new one) we load all campaign data from msdb and populate UI
_restart
()
Reset the module and settings
_updatedTimelinesLengthUI
()
Update UI of total timelines length on length changed
duplicateTimeline
-
i_playerData
Duplicate a campaign_timeline including it's screen layout, channels and blocks
Parameters:
-
i_playerData
Number
Returns:
Unique clientId.
getSelectedCampaign
()
Number
Get currently selected campaign, which we hold a reference to.
Returns:
m_selected_campaign_id
getSelectedTimeline
()
Number
Get currently selected timeline id for campaign
Returns:
m_selected_timeline_id
getTimelineInstance
-
i_campaign_timeline_id
Get selected timeline instance, which we hold a reference to, via it's timeline_id.
Parameters:
-
i_campaign_timeline_id
Number
Returns:
timeline instance
getTimelineViewStack
()
Object
Get the timeline viewstack and provide to others.
Returns:
timeline viewStack instance
initialize
()
Init the instance and listen to VIEW_CHANGED event so we know when it's time to act. If no campaign was selected, we launch the campaign wizard creator, otherwise we populate the campaign / timelines. We also use this method to wire the rest of the campaigns elements.
Returns:
none
populateTimelines
-
order
recreate the UI for all timelines in the timelined sequence supplied
Parameters:
-
order
Arrayof timelines to create
Events
CAMPAIGN_EXPANDED_VIEW
final
static
Custom event fired when a requesing an expanded view of the timelines and storyboard
Event Payload:
-
caller
This -
context
Selfcaller
CAMPAIGN_SELECTED
final
static
Custom event fired before changing to a new campaign
Event Payload:
-
caller
This -
context
Selfcaller
-
UNKNOWN
Event
CAMPAIGN_TIMELINE_CHANGED
final
static
Custom event fired when a timeline or channel or block within the timeline has changed it ignores the event.
Event Payload:
-
caller
This -
context
Selfcaller
-
timelineID
Eventof the timeline selected