Drag drop attachments basic workflow

Signed-off-by: Siddhartha Gupta <makerzzz.zzzz@gmail.com>
- adding checks before uploading to server
- added json_encode

Signed-off-by: Siddhartha Gupta <makerzzz.zzzz@gmail.com>
Working on graceful error handling

Signed-off-by: Siddhartha Gupta <makerzzz.zzzz@gmail.com>
- Working on graceful error handling
- total file size uploaded handling
- separate error function

Signed-off-by: Siddhartha Gupta <makerzzz.zzzz@gmail.com>
- Fix for multiple drop of attachments
- uploading attachments in queue rather than killing the server

Signed-off-by: Siddhartha Gupta <makerzzz.zzzz@gmail.com>
- variable handling

Signed-off-by: Siddhartha Gupta <makerzzz.zzzz@gmail.com>
- removed die and using template layers

Signed-off-by: Siddhartha Gupta <makerzzz.zzzz@gmail.com>
- handing modify message case

Signed-off-by: Siddhartha Gupta <makerzzz.zzzz@gmail.com>
- session checks placed

Signed-off-by: Siddhartha Gupta <makerzzz.zzzz@gmail.com>
- comments placed
- JS modified to prototype revealing pattern
- we have public/private functions in JS

Signed-off-by: Siddhartha Gupta <makerzzz.zzzz@gmail.com>
Compatibility with the current code

Signed-off-by: Siddhartha Gupta <makerzzz.zzzz@gmail.com>
This is not needed

Signed-off-by: emanuele <emanuele45@gmail.com>
Looks like prototype is just a repetition

Signed-off-by: emanuele <emanuele45@gmail.com>
It is already grabbing the url, looks nicer to grab the session as well

Signed-off-by: emanuele <emanuele45@gmail.com>
Seems like success/error/complete should be replaced by done/fail/always

Signed-off-by: emanuele <emanuele45@gmail.com>
Simplified checks

Signed-off-by: emanuele <emanuele45@gmail.com>
Merge pull request #1373 from siddhartha-gupta/dropAttachments2

Drop attachments2