waynehoover/s3_direct_upload — pull request #16 by pomartel (2012-11-06 20:54:51+00:00)
Title: Trigger fail event

I added the triggering of the failed event. I didn't want to expose the raw `data` object returned by jquery-upload so I instead pass the same `content` object that is passed when a file has been successfully uploaded. I extracted the building of the `content` object in a `build_content_object` function.

I also added the `error_thrown` attribute to the `content` object. Let me know if there are other attributes you would like to pass along the returned object.

I also added the possibility to add a `data` attribute to the form helper. I need this to pass extra data parameters like I18n error messages.

Finally, I updated the doc as good as I could. English is not my first language so you can revise it if you have time. I also changed some styles to make it more consistent.

I'm left with two questions. Should the `s3_uploads_complete` be triggered on the form object instead of `document` like all the other events? And should we format the code to use the standard javascript camelCase syntax instead of the Ruby syntax ?