Loading static/script.js +24 −7 Original line number Diff line number Diff line Loading @@ -68,12 +68,14 @@ function makeLoadingElement(title) { return li; } let g_stream = null; function finish(vid1) { const dataDiv = getDataDiv() const submitBtn = getSubmitBtn() const videoInput = getVideoInput() const dataDiv = getDataDiv(); const submitBtn = getSubmitBtn(); const videoInput = getVideoInput(); plausible('FormSubmit') plausible('FormSubmit'); var vid = vid1; if (!isValidVideoId(vid)) { let newVid = getVideoId(vid); Loading Loading @@ -123,6 +125,9 @@ function finish(vid1) { if (stream === null) { return; } g_stream = stream; submitBtn.innerHTML = "Cancel"; submitBtn.disabled = false; const possible_states = Object.freeze({ Preparation: "Preparation", Generation: "Generation", Loading Loading @@ -198,6 +203,11 @@ function finish(vid1) { function pump() { return stream.read().then(({ done, value }) => { if (done) { Object.values(elements).forEach((i) => { if (i.getAttribute("data-status") == "loading") { i.querySelector(".result").innerHTML = `<span class="white">Error</span><br />Did not receive a result from the server.` } }) return; } let text = new TextDecoder().decode(value); Loading Loading @@ -225,14 +235,21 @@ function finish(vid1) { throw (e); }) .finally(() => { g_stream = null; submitBtn.disabled = false; submitBtn.innerHTML = "Search for Captures"; }); } function finishWrpa(data) { const dataDiv = getDataDiv() const submitBtn = getSubmitBtn() if (g_stream !== null) { g_stream.cancel().then((_) => {}); g_stream = null; return false; } const dataDiv = getDataDiv(); const submitBtn = getSubmitBtn(); submitBtn.disabled = true; submitBtn.innerHTML = "Searching..."; Loading Loading
static/script.js +24 −7 Original line number Diff line number Diff line Loading @@ -68,12 +68,14 @@ function makeLoadingElement(title) { return li; } let g_stream = null; function finish(vid1) { const dataDiv = getDataDiv() const submitBtn = getSubmitBtn() const videoInput = getVideoInput() const dataDiv = getDataDiv(); const submitBtn = getSubmitBtn(); const videoInput = getVideoInput(); plausible('FormSubmit') plausible('FormSubmit'); var vid = vid1; if (!isValidVideoId(vid)) { let newVid = getVideoId(vid); Loading Loading @@ -123,6 +125,9 @@ function finish(vid1) { if (stream === null) { return; } g_stream = stream; submitBtn.innerHTML = "Cancel"; submitBtn.disabled = false; const possible_states = Object.freeze({ Preparation: "Preparation", Generation: "Generation", Loading Loading @@ -198,6 +203,11 @@ function finish(vid1) { function pump() { return stream.read().then(({ done, value }) => { if (done) { Object.values(elements).forEach((i) => { if (i.getAttribute("data-status") == "loading") { i.querySelector(".result").innerHTML = `<span class="white">Error</span><br />Did not receive a result from the server.` } }) return; } let text = new TextDecoder().decode(value); Loading Loading @@ -225,14 +235,21 @@ function finish(vid1) { throw (e); }) .finally(() => { g_stream = null; submitBtn.disabled = false; submitBtn.innerHTML = "Search for Captures"; }); } function finishWrpa(data) { const dataDiv = getDataDiv() const submitBtn = getSubmitBtn() if (g_stream !== null) { g_stream.cancel().then((_) => {}); g_stream = null; return false; } const dataDiv = getDataDiv(); const submitBtn = getSubmitBtn(); submitBtn.disabled = true; submitBtn.innerHTML = "Searching..."; Loading