loading_view
code:script.js
let spinner = document.createElement("div");
spinner.style.position = "fixed";
spinner.style.top = "50%";
spinner.style.left = "50%";
spinner.style.translate = "-50% -50%";
spinner.style.padding = "8px";
spinner.style.borderRadius = "50%";
spinner.style.backgroundColor = "#ffffff";
spinner.style.fontSize = "0px";
function svgelegen(name) {
}
let svg_element = svgelegen("svg");
spinner.appendChild(svg_element);
svg_element.setAttribute("width", "48");
svg_element.setAttribute("height", "48");
svg_element.setAttribute("viewBox", "0 0 16 16");
let svg_g_element = svgelegen("g");
svg_element.appendChild(svg_g_element);
svg_g_element.setAttribute("fill", "none");
svg_g_element.setAttribute("fillRule", "evenodd");
svg_g_element.setAttribute("stroke", "#08f");
svg_g_element.setAttribute("stroke-width", "2");
let svg_g_circle_element = svgelegen("circle");
svg_g_element.appendChild(svg_g_circle_element);
svg_g_circle_element.setAttribute("cx", "8");
svg_g_circle_element.setAttribute("cy", "8");
svg_g_circle_element.setAttribute("r", "7");
svg_g_circle_element.setAttribute("opacity", "0.25");
let svg_g_path_element = svgelegen("path");
svg_g_element.appendChild(svg_g_path_element);
svg_g_path_element.setAttribute("d", "M15 8Q14.3,14.3,8,15");
let svg_g_path_at_element = svgelegen("animateTransform");
svg_g_path_element.appendChild(svg_g_path_at_element);
svg_g_path_at_element.setAttribute("attributeName", "transform");
svg_g_path_at_element.setAttribute("type", "rotate");
svg_g_path_at_element.setAttribute("from", "0 8 8");
svg_g_path_at_element.setAttribute("to", "360 8 8");
svg_g_path_at_element.setAttribute("dur", "1s");
svg_g_path_at_element.setAttribute("repeatCount", "indefinite");
function startbusy() {
document.body.appendChild(spinner);
}
function endbusy(e){
spinner.remove();
updatelinks(e);
}
function updatelinks(e) {
console.log(e)
v.removeEventListener("click", startbusy);
v.addEventListener("click", startbusy);
});
document.querySelectorAll('a.dropdown-toggle').forEach((v) => {
v.removeEventListener("click", startbusy);
});
if(scrapbox.Layout == "list") {
document.querySelector('.project-home').removeEventListener("click", startbusy);
}
document.querySelector('.stream-btn>a').removeEventListener("click", startbusy);
}
scrapbox.on("page:changed", endbusy);
scrapbox.on("layout:changed", endbusy);
scrapbox.on("lines:changed", updatelinks);
updatelinks();
window.addEventListener('popstate',startbusy);
// const target = document.querySelector('.status-bar');
// let spinnerstat = false;
// const observer = new MutationObserver(() => {
// if(document.querySelector(".loading-status") == null){
// if(spinnerstat == true){
// spinner.remove();
// spinnerstat = false;
// }
// }else{
// if(spinnerstat == false){
// document.body.appendChild(spinner);
// spinnerstat = true;
// }
// }
// });
// observer.observe(target, {
// childList: true
// });