Add a progress bar to show file upload progress from browser to Django.

When testing locally this bar sort of lies, because the actual bottleneck
is Django→S3.

In prod, our connection to S3 will supposudly be really fast so this won't
matter.

(imported from commit c9f4b4882cbfdf3bbb8180f1500f35d8481c1f39)
This commit is contained in:
Luke Faraone
2013-03-27 11:11:08 -07:00
parent b692e8fc99
commit 424c5b49ef

View File

@@ -487,7 +487,14 @@ $(function () {
$("#send-status").addClass("alert-info")
.show();
$(".send-status-close").one('click', abort_xhr);
$("#error-msg").text("Uploading…");
$("#error-msg").html(
$("<p>").text("Uploading…")
.after('<div class="progress progress-striped active">' +
'<div class="bar" id="upload-bar" style="width: 00%;"></div>' +
'</div>'));
},
progressUpdated: function (i, file, progress) {
$("#upload-bar").width(progress + "%");
},
error: function (err, file) {
var msg;