mirror of
https://github.com/zulip/zulip.git
synced 2025-11-11 01:16:19 +00:00
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:
@@ -487,7 +487,14 @@ $(function () {
|
|||||||
$("#send-status").addClass("alert-info")
|
$("#send-status").addClass("alert-info")
|
||||||
.show();
|
.show();
|
||||||
$(".send-status-close").one('click', abort_xhr);
|
$(".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) {
|
error: function (err, file) {
|
||||||
var msg;
|
var msg;
|
||||||
|
|||||||
Reference in New Issue
Block a user