1
0
mirror of synced 2024-11-17 03:27:13 +01:00

Fix magic button.

Fix download all files not working
This commit is contained in:
j433866 2019-05-01 14:46:05 +01:00
parent f6f60e8203
commit 02bda3250b

View File

@ -414,9 +414,10 @@ class OutputWaiter {
const fileName = window.prompt("Please enter a filename: ", "download.zip"); const fileName = window.prompt("Please enter a filename: ", "download.zip");
const fileExt = window.prompt("Please enter a file extension for the files: ", ".txt"); const fileExt = window.prompt("Please enter a file extension for the files: ", ".txt");
const zip = new Zlib.Zip(); const zip = new Zlib.Zip();
for (let i = 0; i < this.outputs.length; i++) { const inputNums = Object.keys(this.outputs);
const name = Utils.strToByteArray(this.outputs[i].inputNum + fileExt); for (let i = 0; i < inputNums.length; i++) {
let out = this.getOutput(this.outputs[i].inputNum); const name = Utils.strToByteArray(inputNums[i] + fileExt);
let out = this.getOutput(inputNums[i]);
if (typeof out === "string") { if (typeof out === "string") {
out = Utils.strToUtf8ByteArray(out); out = Utils.strToUtf8ByteArray(out);
} }
@ -479,6 +480,7 @@ class OutputWaiter {
changeTab(inputNum, changeInput = false) { changeTab(inputNum, changeInput = false) {
const currentNum = this.getActiveTab(); const currentNum = this.getActiveTab();
if (this.getOutput(inputNum) === -1) return; if (this.getOutput(inputNum) === -1) return;
this.hideMagicButton();
const tabsWrapper = document.getElementById("output-tabs"); const tabsWrapper = document.getElementById("output-tabs");
const tabs = tabsWrapper.children; const tabs = tabsWrapper.children;
@ -828,10 +830,9 @@ class OutputWaiter {
*/ */
backgroundMagic() { backgroundMagic() {
this.hideMagicButton(); this.hideMagicButton();
if (!this.app.options.autoMagic || this.getActive()) return; if (!this.app.options.autoMagic || !this.getActive()) return;
const sample = this.getActive().slice(0, 1000) || ""; const sample = this.getActive().slice(0, 1000) || "";
if (sample.length || sample.byteLength) {
if (sample.length) {
this.manager.background.magic(sample); this.manager.background.magic(sample);
} }
} }