prose/prose — pull request #255 by hannesl (2012-10-23 20:21:18+00:00)
Title: Upload files

I'm working on a file upload feature, inspired by [this issue](https://github.com/prose/prose/issues/204). I'm trying to keep things as simple as possible for now – posting this to get some feedback before I put too much work into it.

I added an upload button to the repo browser view. It allows you to upload a single file, and you are redirected to the edit post view where you'll se the contents of the file. If the file name matches one of the files in the current path, the post view goes into 'edit' mode, and you'll be able to see the difference between the existing and the uploaded file before saving. Cool, huh?

A couple of TODOs:

* Add a check to see if the browser supports native file handling, and hide/disable the button otherwise.
* The upload button acts weird when the file is uploading. The 'active' class probably needs to be more specifically targeted, and the button should have some 'active' styling of its own while the file is transferred.
* Support binary files. This means replacing the editor with some kind of file icon or image preview, and perhaps show some file info such as file size etc. We could save this for another pull request if you prefer.