Neighbourhood.omg.lol/wwwroot/js/csharp.js
Gordon Pedersen 25f362bfc5 Added a way to edit the profile page
Including custom css and head content, but not custom themes or metadata (yet)
2024-07-05 15:47:05 +10:00

31 lines
No EOL
644 B
JavaScript

window.injectCSharp = async function (helper) {
window.CSHARP = helper
}
async function delay(t) {
return new Promise((resolve) => {
setTimeout(resolve, t);
});
}
async function removeElementById(id) {
document.getElementById(id)?.remove()
}
function scrollToId(id) {
const element = document.getElementById(id);
if (element instanceof HTMLElement) {
element.scrollIntoView({
behavior: "smooth",
block: "start",
inline: "nearest"
});
}
}
function toggleDetails(id) {
const element = document.getElementById(id)
if (element instanceof HTMLDetailsElement)
element.open = !element.open
}