Skip to content

Commit

Permalink
Update arma3.js
Browse files Browse the repository at this point in the history
  • Loading branch information
OshidaBCF committed Jan 11, 2024
1 parent e55fdb6 commit 4f38618
Showing 1 changed file with 23 additions and 2 deletions.
25 changes: 23 additions & 2 deletions js/arma3.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,32 @@

const uploadInput = document.getElementById("armaModpackFile")

function parseArmaModpackPreset()
{
selectedFile = uploadInput.files[0];
}

function waitForElm(selector) {
return new Promise(resolve => {
if (document.querySelector(selector)) {
return resolve(document.querySelector(selector));
}

const observer = new MutationObserver(mutations => {
if (document.querySelector(selector)) {
resolve(document.querySelector(selector));
observer.disconnect();
}
});

observer.observe(document.body, {
childList: true,
subtree: true
});
});
}

waitForElm("#body > button")
uploadInput = document.getElementById("armaModpackFile")

uploadInput.addEventListener(
"change",
() => {
Expand Down

0 comments on commit 4f38618

Please sign in to comment.