Show:

I am the ResourceManager.

I contain the business logic for managing all Resources and rendering lists of them for display.

I am closely connected with ViewResource.

Methods

bytesToSize

(
  • bytes
)

I calculate from the numeric bytesize a human readable string

Parameters:

Returns:

String

checkResourceInput

(
  • uriValue
  • nameValue
)

I perform some client-side validations on an URI input field

Parameters:

Returns:

createResource

(
  • src
  • type
  • name
  • thumb
)

PLEASE DOCUMENT THIS.

Parameters:

Returns:

r

deleteResource

(
  • projectID
  • resourceID
  • successCallback
  • cancelCallback
)

I delete a resource from the server.

Parameters:

getCompleteList

(
  • targetElement
)
private

I am the method choosen, when ResourceManager/renderList is called with filter set to false.

I update the resource database and the render the result into the targetElement

Parameters:

getFilteredList

(
  • targetElement
  • projectID
  • key
  • condition
  • value
)
private

I am the method choosen, when ResourceManager/renderList is called with filter set to true.

The server will be asked to return a list of resources, which meet the requierements specified with key, considition, value (e.g. "type" "==" "video" ). See the server docs for more details!

Parameters:

renderList

(
  • targetElement
  • filter
  • projectID
  • key
  • condition
  • value
)

I render a list of thumbnails for either all resource items of the project, or a narrowed down set of them.

The targetElement should be a <div> or likewise, and will afterwards contain the elements which were rendered from e.g. ResourceImage/renderThumb

If filter is true, then the method will ask the server only for a list of resources which meet the key-condition-value requirements (e.g. "type" "==" "video"). See also server docs!

Note: projectID must be set!

Parameters:

renderResourcePicker

(
  • targetElement
)

I render into the targetElement, which should be a <div> or likewise, a set of thumbnails. These thumbnails are draggable in the <div id="MainContainer"> to allow drop actions into timelines or into the overlay container.

Parameters:

renderResult

(
  • targetElement
  • array
)
private

I call the .renderThumb method for all Resource data objects in the array (e.g. ResourceImage/renderThumb) and append the returned element to targetElement.

Parameters:

success

()

Description

Returns:

updateResourceDatabase

()

I tell the Database to reload the index data.

uploadResource

(
  • successCallback
  • onlyVideo
)

I open a jquery UI dialog, which allows the user to upload a new resource. When the onlyVideo parameter is set to true, I allow only uploads of videos (needed during creation of a new hypervideo)

Parameters: