|
|
@@ -54,13 +54,41 @@ window.addEventListener("scroll", function (e) { |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
function editPage(repoJsId) { |
|
|
|
let relPath = "../".repeat(relPathDepth - 1); |
|
|
|
var el = document.createElement('script'); |
|
|
|
el.onload = ()=> { |
|
|
|
console.log("loading...") |
|
|
|
console.log(repo) |
|
|
|
} |
|
|
|
el.src = `${relPath}js/repo/${repoJsId}.js` |
|
|
|
document.body.appendChild(el) |
|
|
|
document.location.href = `${relPath}svedit/index.html#${repoJsId}` |
|
|
|
ev} |
|
|
|
|
|
|
|
window.addEventListener("keyup", (e)=> { |
|
|
|
if (e.key == "e") { |
|
|
|
editPage(sandpointsPageId) |
|
|
|
} |
|
|
|
}) |
|
|
|
|
|
|
|
window.addEventListener("DOMContentLoaded", (e) => { |
|
|
|
document.querySelectorAll('.triadlink').forEach((i) => { |
|
|
|
console.log(i) |
|
|
|
i.addEventListener("click", (ev) => { |
|
|
|
if (ev.ctrlKey) { |
|
|
|
ev.preventDefault() |
|
|
|
editPage(ev.target.getAttribute("repoid")) |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
let preview = document.querySelector("#preview"); |
|
|
|
if ( |
|
|
|
location.pathname.split("/").includes("_preview") || |
|
|
|
location.hash.startsWith("#/_edit") |
|
|
|
) { |
|
|
|
preview.style.display = "flex"; |
|
|
|
evpreview.style.display = "flex"; |
|
|
|
} |
|
|
|
|
|
|
|
let par = document.querySelector( |
|
|
|