Show:

I am the type definition of a ResourceText.

  • Text Resources only appear in the 'Add Custom Overlay' tab and are not listed in the ResourceManager.

  • Text Resources can not be used as Annotation or Videolink

Methods

openPreview

(
  • elementOrigin
)

I create a preview dialog, call the .renderContent method of a given resource (e.g. ResourceImage/renderContent) and append the returned element to the dialog.

Parameters:

renderBasicPropertiesControls

(
  • overlay
)

When an Overlay got into Focus, its properties and some additional controls to edit the overlay's attributes should be shown in the right window of the player.

I provide a basic method, which can be extended by my sub-types.

I render properities controls for the UI for the overlay's following attributes:

  • overlay.data.start
  • overlay.data.end
  • overlay.data.position.top
  • overlay.data.position.left
  • overlay.data.position.width
  • overlay.data.position.height

Why is this function a method of Resource and not Overlay? --> Because there is only one type of Overlay, but this can hold in its resourceData attribute different types of Resources. And because the properties controls can depend on resourceData, the method is placed here and in the sub-types of Resource.

Parameters:

Returns:

{ controlsContainer: HTMLElement, changeStart: Function, changeEnd: Function, changeDimensions: Function }

renderContent

()

I render the content of myself, which is a <div> containing a custom text wrapped in a <div class="resourceDetail" ...>

Returns:

HTMLElement

renderPropertiesControls

(
  • overlay
)

Parameters:

Returns:

{ controlsContainer: HTMLElement, changeStart: Function, changeEnd: Function, changeDimensions: Function }

renderThumb

()

Several modules need me to render a thumb of myself.

These thumbs have a special structure of HTMLElements, where several data-attributes carry the information needed.

Returns:

thumbElement

Attributes

resourceData

I hold the data object of a custom ResourceText, which is not stored in the Databse and doesn't appear in the resource's _index.json.