Skip to content

Commit

Permalink
Prettified Code!
Browse files Browse the repository at this point in the history
  • Loading branch information
ROBlNET13 authored and actions-user committed Dec 14, 2024
1 parent 493ee08 commit 605019b
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 19 deletions.
1 change: 0 additions & 1 deletion game/js/Cfunction.js
Original file line number Diff line number Diff line change
Expand Up @@ -2765,7 +2765,6 @@ var $User = (function () {
SetBlock($("dSurface"), $("dZombieFail"));
oSym.Stop();
}),

(PrepareGrowPlants = function (a) {
var b = function () {
PlayAudio("readysetplant");
Expand Down
38 changes: 20 additions & 18 deletions game/js/Custom.js
Original file line number Diff line number Diff line change
@@ -1,27 +1,29 @@
function waitForElm(selector) {
return new Promise(resolve => {
if (document.querySelector(selector)) {
return resolve(document.querySelector(selector));
}
return new Promise((resolve) => {
if (document.querySelector(selector)) {
return resolve(document.querySelector(selector));
}

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

// If you get "parameter 1 is not of type 'Node'" error, see https://stackoverflow.com/a/77855838/492336
observer.observe(document.body, {
childList: true,
subtree: true
});
});
// If you get "parameter 1 is not of type 'Node'" error, see https://stackoverflow.com/a/77855838/492336
observer.observe(document.body, {
childList: true,
subtree: true,
});
});
}
// wait for #commit to exist
waitForElm('#commit').then(elm => {
waitForElm("#commit").then((elm) => {
// set the innertext to that of the contents of ../v.txt
fetch('../v.txt').then(response => response.text()).then(text => elm.innerText = text);
fetch("../v.txt")
.then((response) => response.text())
.then((text) => (elm.innerText = text));
});

const saveWhitelist = [
Expand Down

0 comments on commit 605019b

Please sign in to comment.