diff --git a/app/static/js/opaque.js b/app/static/js/opaque.js new file mode 100644 index 00000000..0e23679d --- /dev/null +++ b/app/static/js/opaque.js @@ -0,0 +1,30 @@ +function sendNewJobFormData(form, progress) { + var XHR = new XMLHttpRequest(); + var FD = new FormData(form); + XHR.upload.addEventListener("progress", function(event) { + progress.querySelector(".determinate").style.width = ((event.loaded / event.total) * 100).toString() + "%"; + }); + XHR.addEventListener("loadend", function(event) { + form.reset(); + location.reload(); + }); + XHR.open("POST", window.location.href); + XHR.send(FD); +} +function initNewJobForm(newJobFormElement) { + newJobFormElement.addEventListener("submit", function(event) { + event.preventDefault(); + var toast = M.toast( + {html: `