Merge branch 'development' of gitlab.ub.uni-bielefeld.de:sfb1288inf/opaque into development

This commit is contained in:
Stephan Porada 2019-09-17 16:31:45 +02:00
commit 0ea87de072
3 changed files with 11 additions and 7 deletions

View File

@ -10,14 +10,18 @@ function sendNewJobFormData(newJobFormElement, progressModalElement, request) {
progressModal.options.dismissible = false;
progressModalElement.querySelector(".title").innerHTML = newJobFormElement.title.value;
request.upload.addEventListener("progress", function(event) {
progressModalElement.querySelector(".loaded").innerHTML = event.loaded.toString();
progressModalElement.querySelector(".total").innerHTML = event.total.toString();
progressModalElement.querySelector(".determinate").style.width = ((event.loaded / event.total) * 100).toString() + "%";
progressInPercent = Math.floor(100 * event.loaded / event.total).toString() + "%";
progressModalElement.querySelector(".progress-in-percent").innerHTML = progressInPercent;
progressModalElement.querySelector(".determinate").style.width = progressInPercent;
});
request.addEventListener("load", function(event) {
newJobFormElement.reset();
location.reload();
});
request.addEventListener("abort", function(event) {
progressModalElement.querySelector(".progress-in-percent").innerHTML = "0%";
progressModalElement.querySelector(".determinate").style.width = "0%";
});
progressModal.open();
request.open("POST", window.location.href);

View File

@ -124,11 +124,11 @@
<div id="progress-modal" class="modal">
<div class="modal-content">
<h4 class="title"></h4>
<p>Uploading files... <span class="loaded"></span>/<span class="total"></span></p>
<h4><i class="material-icons prefix">file_upload</i> Uploading files for <span class="title"></span></h4>
<div class="progress">
<div class="determinate" style="width: 0%"></div>
</div>
<p><span class="progress-in-percent"></span> uploaded</p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-close waves-effect waves-green btn red cancel">Cancel</a>

View File

@ -141,11 +141,11 @@
<div id="progress-modal" class="modal">
<div class="modal-content">
<h4 class="title"></h4>
<p>Uploading files... <span class="loaded"></span>/<span class="total"></span></p>
<h4><i class="material-icons prefix">file_upload</i> Uploading files for <span class="title"></span></h4>
<div class="progress">
<div class="determinate" style="width: 0%"></div>
</div>
<p><span class="progress-in-percent"></span> uploaded</p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-close waves-effect waves-green btn red cancel">Cancel</a>