highfidelity/hifi — pull request #2766 by huffman (2014-05-01 21:42:41+00:00)
Title: Worklist Job #19615 - Add programmatic access to "file browser" to Interface JavaScript

Worklist job https://worklist.net/19615

> Although standard JavaScript doesn't support a FileBrowser dialog box, we would like to expose a simple programmable interface to our basic JavaScript interface to pop up a file browser dialog box, and have it return the file name chosen by the user.

> The interface should be similar to widnow.alert() or window.confirm(). (See https://worklist.net/19612 for exposing the "window" object to scripting.)

> The parameters should be:
* Window Title - string which is used as the window title
* Starting Director - string which is the starting directory for the browser
* list of filters - string with double semi-colon separated list of file extension filters that should be included... the filters are specified as a space separated list of "anything*something". If the filters are wrapped in parenthesis, then only the section inside the parenthesis will be used for identifying filters, but the rest of the text will be used to display the filters.
e.g: "Images (*.png *.xpm *.jpg);;Text files (*.txt);;XML files (*.xml)" -

> When called the code should pop up our standard file browser dialog box, with the parameters as specified. When the user clicks OK, the result should be returned to the script as a string (much like the window.prompt() method.