diff --git a/src/pix360core/static/js/worker.js b/src/pix360core/static/js/worker.js index 4336d9d..f1266ac 100644 --- a/src/pix360core/static/js/worker.js +++ b/src/pix360core/static/js/worker.js @@ -29,48 +29,44 @@ function deletecard(jobid) { } function checkServerForFile(jobid, title, interval) { - $.ajax({ - type: "GET", - cache: false, - url: "/status/" + jobid, - statusCode: { - 403: function () { - Notification.requestPermission(function (permission) { - if (permission === "granted") { - var notification = new Notification("PIX360", { - body: "Your session has expired. Please log in again.", - }); - } - }); - window.location.href = "/"; - }, - 404: function () { - clearInterval(intervals[jobid]); - failcard(jobid, title); - return; - }, - 200: function (data, tstatus, xhr) { - if (data.status == "completed") { - clearInterval(intervals[jobid]); - finishcard( - jobid, - title, - data.content_type == "video/mp4" - ); - return; - } else if (data.status == "failed") { - clearInterval(intervals[jobid]); - failcard(jobid, title); - return; + $.ajax({ + type: "GET", + cache: false, + url: "/status/" + jobid, + statusCode: { + 403: function () { + Notification.requestPermission(function (permission) { + if (permission === "granted") { + var notification = new Notification("PIX360", { + body: "Your session has expired. Please log in again.", + }); } - }, - 500: function () { + }); + window.location.href = "/"; + }, + 404: function () { + clearInterval(intervals[jobid]); + failcard(jobid, title); + return; + }, + 200: function (data, tstatus, xhr) { + if (data.status == "completed") { + clearInterval(intervals[jobid]); + finishcard(jobid, title, data.content_type == "video/mp4"); + return; + } else if (data.status == "failed") { clearInterval(intervals[jobid]); failcard(jobid, title); return; - }, + } }, - }); + 500: function () { + clearInterval(intervals[jobid]); + failcard(jobid, title); + return; + }, + }, + }); } function addcard(jobid, title) { @@ -108,7 +104,9 @@ function failcard(jobid, title) { '
'; @@ -124,33 +122,27 @@ function finishcard(jobid, title, video) { } }); var text = - '