app/assets/javascripts/backbone/views/page.js.coffee in tawork-0.0.10 vs app/assets/javascripts/backbone/views/page.js.coffee in tawork-0.0.11
- old
+ new
@@ -35,11 +35,11 @@
runtimes: "html5"
browse_button: "pickfiles" # you can pass in id...
container: document.getElementById("attachments") # ... or DOM Element itself
url: "/wiki/pages/#{@page_id}/attach"
filters:
- max_file_size: "50mb"
+ max_file_size: "100mb"
multipart_params:
authenticity_token: $("meta[name=csrf-token]").attr('content')
init:
PostInit: ->
@@ -47,13 +47,14 @@
# document.getElementById("uploadfiles").onclick = ->
# uploader.start()
# false
FilesAdded: (up, files) ->
- plupload.each files, (file) ->
- $template = $($("#upload_template").clone().html())
- $template.attr("id", file.id).find(".filename").text(file.name + "(#{plupload.formatSize(file.size)})")
+ for file in files
+ $template = $($("#upload_template").clone().html()).addClass("file-#{file.id}")
+ $template.attr("id", file.id).find(".filename").text(file.name + "(#{plupload.formatSize(file.size)})").end().find(".bar").css(width: "0%")
$("#filelist").append $template
+
uploader.start()
UploadProgress: (up, file) ->
$("##{file.id}").find(".bar").css(width: "#{file.percent}%")