2024-06-11 07:24:52 +00:00
|
|
|
|
window.injectCSharp = async function (helper) {
|
|
|
|
|
window.CSHARP = helper
|
2024-06-13 04:46:24 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
async function delay(t) {
|
|
|
|
|
return new Promise((resolve) => {
|
|
|
|
|
setTimeout(resolve, t);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async function removeElementById(id) {
|
|
|
|
|
document.getElementById(id)?.remove()
|
2024-06-20 04:25:48 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function scrollToId(id) {
|
|
|
|
|
const element = document.getElementById(id);
|
|
|
|
|
if (element instanceof HTMLElement) {
|
|
|
|
|
element.scrollIntoView({
|
|
|
|
|
behavior: "smooth",
|
|
|
|
|
block: "start",
|
|
|
|
|
inline: "nearest"
|
|
|
|
|
});
|
|
|
|
|
}
|
2024-07-05 05:47:05 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function toggleDetails(id) {
|
|
|
|
|
const element = document.getElementById(id)
|
|
|
|
|
if (element instanceof HTMLDetailsElement)
|
|
|
|
|
element.open = !element.open
|
2024-07-11 05:57:53 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function cacheBust(url) {
|
|
|
|
|
fetch(new Request(url), {
|
|
|
|
|
headers: new Headers({
|
|
|
|
|
"pragma": "no-cache",
|
|
|
|
|
"cache-control": "no-cache"
|
|
|
|
|
}),
|
|
|
|
|
mode: 'no-cors',
|
|
|
|
|
cache: 'no-cache',
|
|
|
|
|
})
|
|
|
|
|
.finally(() => {
|
|
|
|
|
let els = document.querySelectorAll(`[src="${url}"]`)
|
|
|
|
|
els.forEach(el => el.removeAttribute('src'))
|
|
|
|
|
els.forEach(el => el.src = url)
|
|
|
|
|
})
|
2024-06-11 07:24:52 +00:00
|
|
|
|
}
|