VideolinksController Module
I am the VideolinksController. I am responsible for managing all the videolinks in the current HypervideoModel, and for displaying them for viewing and editing.
Item Index
Methods
Attributes
Methods
changeViewSize
()
I react to changes in the global state "viewSize" (which is triggerd by a resize event of the window).
deleteVideolink
-
videolink
I am the starting point for the process of deleting a videolink. I call other necessary methods for it.
Parameters:
-
videolink
Videolink
distributeTiles
()
I distribute the tileElements in the tileContainer, so that they match closely to the position of their related timelineElements. When they would start to overlap, I arrange them in groups.
See also Videolink.
initController
()
I tell all videolinks in the HypervideoModel/videolinks attribute to render their elements into the DOM.
initEditOptions
()
private
When the editMode 'links' was entered, the #EditingOptions area should show two tabs:
- a list of (draggable) thumbnails with available hypervideos
- a text form, where the user can manually input a link URL
makeTimelineDroppable
-
active
When the editMode 'link' has been entered, the videolink timeline should be droppable for new items (from the tab of available hypervideos, see VideolinksController/initEditOptions). A drop event should trigger the process of creating a new videolink. My parameter is true or false to activate or deactivate this behavior.
Parameters:
-
active
Boolean
onViewSizeChanged
()
private
I react to changes in the global state viewSizeChanged. The state changes after a window resize event and is meant to be used for performance-heavy operations.
rearrangeTilesAndContent
()
I remove all tileElements and videolinkElements from the DOM and then re-append them again.
This has the purpose that the DOM elements must appear in a sorted order by their start time. So this method has to called after the user has finished editing.
resetTimelineView
()
private
When we are in the editMode annotations, the timeline should show all timeline elements stacked. After leaving this mode, I have to reset the timelineElements and the timeline to their normal layout.
setOpenedLink
-
videolink
I open the videolinkElement of a videolink in the videolinkContainer.
If my parameter is null, I close the videolinkContainer.
Parameters:
-
videolink
Videolink
setVideolinkInFocus
-
videolink
When a videolink is set into focus, I have to tell the old videolink in the var videolinkInFocus, that it is no longer in focus. Then I store the videolink (or null) from my parameter in the var videolinkInFocus, and inform it about it.
Parameters:
-
videolink
Videolink
stackTimelineView
()
When we are in the editMode annotations, the timeline should show all timeline elements stacked, which is what I do.
toggleEditMode
-
editMode
-
oldEditMode
I listens to the global state 'editMode'.
If we enter the editMode "links" I prepare all videolinks for editing, prepare the timeline and the "editOptions" interface.
When leaving I reset them.
toggleSidebarOpen
()
I react to changes in the global state "sidebarOpen".
toggleViewMode
-
viewMode
-
oldViewMode
I react to changes in the global state "viewMode".
updateStatesOfVideolinks
-
currentTime
I am a central method of the VideolinksController. I am called from the update functions inside the HypervideoController and I set the activeState of the videolinks according to the current time.
Parameters:
-
currentTime
Number
Attributes
openedLink
Videolink
I hold the currently opened videolink (or null, when there is no opened link). I use the VideolinksController/setOpenedLink().
videolinkInFocus
Videolink
I hold the videolink which is "in focus" (or null, when there is no link in focus). I use the VideolinksController/setVideolinkInFocus().