553
OPUS Projektor Manual
JavaScript
below /opt/user_files, the current USB mount path is automatically prepended to the path and
the directory is created on the USB stick.
The path may not contain a ".." or "*".
Prototype:
var result = createUSBDirectory(string directoryPath);
The result of the function will be true if creating the directory was successful (or the directory
already exists) or false if
-the path contains a ".." or "*"
-the path is not inside of /opt/user_files and no USB stick is inserted
-creating the directory failed for unknown reasons
getDirectoryContent - Get the contents of a directory
With this function the contents of a directory can be read.
The first parameter is the path to the directory that shall be read. The second parameter is
optional and can be used to filter the result to contain only files or only directories. Use
"DIRECTORIES_ONLY" or "FILES_ONLY" as filter options. If the second parameter is
omitted or has an other value than the two filter options, files and directories will be returned.
Prototype:
var result = getDirectoryContent(string directoryPath, string
optionalFilter);
The function will return undefined if the contents of the provided directory could not be read. If
the contents were read successfully, an array of strings will be returned that contains all file
and/or directory names inside of the provided directory path.
deleteFileOrDirectory- Delete a file or directory on a USB stick or in user_files
With this function a file or directory can be deleted. A file or directory can only be deleted if it
is either on a USB stick or in the user_files directory (/opt/user_files).
The function's only parameter is the path to the file or directory that shall be deleted. To erase
the contents of a folder an asterisk may be provided at the the end of the path (e.g.
"/opt/user_files/*").
A ".." may not be contained in the provided path.
Prototype:
var result = deleteFileOrDirectory(string directoryOrFilePath);
The function returns true if the directory or file(s) were deleted successfully. It returns false if
the file(s) or directory could not be deleted.
setFocus - Set navigation focus to certain object
Tutorial video of the setFocus function
https://www.youtube.com/watch?v=9IjFMmBQ45Q