coreybutler/fenix — pull request #32 by xqwzts (2014-06-18 07:12:22+00:00)
Title: Enabled server creation via drag and drop.

- Disabled default WebKit drag/drop behavior. [_Otherwise dropping a folder will switch webkit out of fenix and into that folder view._]
- Captured drag/drop behavior on the server div to add/remove a dragHover class.
- Added simple dragHover style to main.css stylesheet.
- If a callback was passed to UI.server.create, call it.
- Iterate over the drag-dropped objects recursively [to execute in series], creating a server for each folder provided.

Suggested in https://github.com/coreybutler/fenix/issues/16

##### Notes: #####

This implementation auto-generates a server name based on the file.name property of the FileItem that was dropped, this should be equivalent to `path.basedir()`, staying consistent with fenix-cli.

A server will be created from a drag/dropped folder only, files and other objects are ignored.

If multiple folders are dropped it will create them in series, to ensure that they each get a unique port.

My CSS skills are severely lacking, so all the `dragHover` class does is set a grey background on the drop area, if this is too jarring hopefully it can be improved.