Show:

I am the VideolinksController. I am responsible for managing all the videolinks in the current HypervideoModel, and for displaying them for viewing and editing.

Methods

changeViewSize

()

I react to changes in the global state "viewSize" (which is triggerd by a resize event of the window).

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:

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.

setVideolinkInFocus

(
  • videolink
)
private

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:

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.

Parameters:

toggleSidebarOpen

()

I react to changes in the global state "sidebarOpen".

toggleViewMode

(
  • viewMode
  • oldViewMode
)

I react to changes in the global state "viewMode".

Parameters:

Attributes

videolinkInFocus

Videolink

I hold the videolink which is "in focus" (or null, when there is no link in focus). I use the VideolinksController/setVideolinkInFocus().