Skip to content

Commit

Permalink
Fixes file size by setting it to 100mb. Adds messages for errors
Browse files Browse the repository at this point in the history
Signed-off-by: Akash Manohar J <akash@akash.im>
  • Loading branch information
HashNuke committed Apr 10, 2012
1 parent c4baac9 commit 7b88b88
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion app/assets/javascripts/backbone/plugins/attachments.js.coffee
Expand Up @@ -87,14 +87,28 @@ class Kandan.Plugins.Attachments
fallback_id: "file"
url : "/channels/#{channel_id}/attachments.json",
paramname : "file"
maxfilesize: 100
queuefiles : 1

uploadStarted: =>
uploadStarted: ->
$(".dropzone").text("Uploading...")

error: (err, file)->
if err == "BrowserNotSupported"
$(".dropzone").text("Browser not supported")
else if err == "FileTooLarge"
$(".dropzone").text("File too large")
else
$(".dropzone").text("Sorry bud! couldn't upload")


uploadFinished: (i, file, response, time)->
$(".dropzone").text("Drop files here to upload")
Kandan.Widgets.render "Kandan.Plugins.Attachments"

progressUpdated: (i, file, progress)->
# TODO update dropzone text

dragOver: ->
console.log "reached dropzone!"
})
Expand Down

0 comments on commit 7b88b88

Please sign in to comment.