discord edition patch
This commit is contained in:
parent
ec3ea2e783
commit
e9fa0d65b5
|
|
@ -13263,6 +13263,11 @@ if (standalone) {
|
|||
script.src = "mods/steam_port.js";
|
||||
document.head.appendChild(script);
|
||||
}
|
||||
else if (standaloneType === "discord") {
|
||||
var script = document.createElement('script');
|
||||
script.src = "mods/discord_port.js";
|
||||
document.head.appendChild(script);
|
||||
}
|
||||
|
||||
document.documentElement.classList.add("standalone");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,36 @@
|
|||
// For the Sandboxels Discord activity: https://discord.com/oauth2/authorize?client_id=1360770918732796117
|
||||
|
||||
function convertListeners() {
|
||||
document.querySelectorAll("*[onclick]").forEach((e) => {
|
||||
e.addEventListener("click", e.onclick);
|
||||
e.removeAttribute("onclick");
|
||||
})
|
||||
document.querySelectorAll("*[oninput]").forEach((e) => {
|
||||
e.addEventListener("input", e.oninput);
|
||||
e.removeAttribute("oninput");
|
||||
})
|
||||
document.querySelectorAll("*[onchange]").forEach((e) => {
|
||||
e.addEventListener("change", e.onchange);
|
||||
e.removeAttribute("onchange");
|
||||
})
|
||||
}
|
||||
|
||||
_showPromptScreen = showPromptScreen;
|
||||
showPromptScreen = function() {
|
||||
_showPromptScreen();
|
||||
convertListeners();
|
||||
}
|
||||
|
||||
_showInfo = showInfo;
|
||||
showInfo = function() {
|
||||
_showInfo();
|
||||
convertListeners();
|
||||
}
|
||||
|
||||
_getDiscordSaves = getDiscordSaves;
|
||||
getDiscordSaves = function() {
|
||||
_getDiscordSaves();
|
||||
convertListeners();
|
||||
}
|
||||
|
||||
window.addEventListener("load", convertListeners);
|
||||
Loading…
Reference in New Issue