diff --git a/src/web/App.mjs b/src/web/App.mjs index 25efd152..24715559 100755 --- a/src/web/App.mjs +++ b/src/web/App.mjs @@ -198,7 +198,10 @@ class App { * @param {boolean} [silent=false] - Suppress statechange event */ setInput(input, silent=false) { - this.manager.input.set(input, silent); + // Assume that there aren't any inputs + let inputNum = this.manager.input.getActiveTab(); + if (inputNum === -1) inputNum = 1; + this.manager.input.updateInputValue(inputNum, input); } @@ -446,7 +449,7 @@ class App { if (this.uriParams.input) { try { const inputData = fromBase64(this.uriParams.input); - this.setInput(inputData, true); + this.setInput(inputData, false); } catch (err) {} } diff --git a/src/web/ControlsWaiter.mjs b/src/web/ControlsWaiter.mjs index 56cfebdd..f2997ff0 100755 --- a/src/web/ControlsWaiter.mjs +++ b/src/web/ControlsWaiter.mjs @@ -387,19 +387,19 @@ ${navigator.userAgent} const bakeButton = document.getElementById("bake"), btnText = bakeButton.querySelector("span"); - bakeButton.style.background = ""; - if (cancel) { btnText.innerText = "Cancel"; bakeButton.classList.remove("btn-success"); bakeButton.classList.remove("btn-warning"); bakeButton.classList.add("btn-danger"); } else if (loading) { + bakeButton.style.background = ""; btnText.innerText = "Loading..."; bakeButton.classList.remove("btn-success"); bakeButton.classList.remove("btn-danger"); bakeButton.classList.add("btn-warning"); } else { + bakeButton.style.background = ""; btnText.innerText = "Bake!"; bakeButton.classList.remove("btn-danger"); bakeButton.classList.remove("btn-warning"); diff --git a/src/web/InputWaiter.mjs b/src/web/InputWaiter.mjs index 79da4d74..d8c55751 100644 --- a/src/web/InputWaiter.mjs +++ b/src/web/InputWaiter.mjs @@ -745,6 +745,14 @@ class InputWaiter { this.updateFileProgress(loadedData.activeProgress.inputNum, loadedData.activeProgress.progress); + const inputTitle = document.getElementById("input").firstElementChild; + if (loaded < total) { + const percentComplete = (loaded + loading) / total * 100; + inputTitle.style.background = `linear-gradient(to right, var(--title-background-colour) ${percentComplete}%, var(--primary-background-colour) ${percentComplete}%)`; + } else { + inputTitle.style.background = ""; + } + if (loaded < total && autoRefresh) { setTimeout(function() { this.inputWorker.postMessage({ diff --git a/src/web/InputWorker.mjs b/src/web/InputWorker.mjs index 1aa57084..ec56004e 100644 --- a/src/web/InputWorker.mjs +++ b/src/web/InputWorker.mjs @@ -127,7 +127,7 @@ self.autoBake = function(inputNum) { data: { input: inputData, inputNum: parseInt(inputNum, 10), - override: true + override: false } }); self.postMessage({ diff --git a/src/web/WorkerWaiter.mjs b/src/web/WorkerWaiter.mjs index ec8ca3ef..fb8939fd 100644 --- a/src/web/WorkerWaiter.mjs +++ b/src/web/WorkerWaiter.mjs @@ -322,7 +322,6 @@ class WorkerWaiter { if (typeof nextInput.inputNum === "string") nextInput.inputNum = parseInt(nextInput.inputNum, 10); log.debug(`Baking input ${nextInput.inputNum}.`); - this.setBakingStatus(true); this.manager.output.updateOutputStatus("baking", nextInput.inputNum); this.manager.output.updateOutputMessage(`Baking input ${nextInput.inputNum}...`, nextInput.inputNum); @@ -404,12 +403,8 @@ class WorkerWaiter { if (inputData.override) { - for (let i = this.chefWorkers.length - 1; i >= 0; i--) { - this.removeChefWorker(this.chefWorkers[i]); - } this.totalOutputs = 1; this.inputs = [inputData]; - this.bakeNextInput(this.addChefWorker()); } else { this.totalOutputs++; this.inputs.push(inputData);