ResourceManager Module
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.
Item Index
Methods
bytesToSize
-
bytes
I calculate from the numeric bytesize a human readable string
Parameters:
-
bytesNumber
Returns:
String
checkResourceInput
-
uriValue -
nameValue
I perform some client-side validations on an URI input field
Returns:
createResource
-
src -
type -
name -
thumb
PLEASE DOCUMENT THIS.
Returns:
r
deleteResource
-
projectID -
resourceID -
successCallback -
cancelCallback
I delete a resource from the server.
getCompleteList
-
targetElement
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:
-
targetElementHTMLElement
getFilteredList
-
targetElement -
projectID -
key -
condition -
value
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:
-
targetElementHTMLElement -
projectIDString -
keyString -
conditionString -
valueString
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!
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:
-
targetElementHTMLElement
renderResult
-
targetElement -
array
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:
-
targetElementHTMLElement -
arrayArray
success
()
Description
API Docs