initial preparation to not just edit but also add new pages via local editor..

master
Marcell Mars 3 years ago
parent b0ec5615b1
commit e78d2af1b9

@ -63,12 +63,20 @@ function editPage(repoJsId) {
}
el.src = `${relPath}js/repo/${repoJsId}.js`
document.body.appendChild(el)
document.location.href = `${relPath}edit/index.html#${repoJsId}`
document.location.href = `${relPath}edit/index.html?edit=${repoJsId}`
ev}
window.addEventListener("keyup", (e)=> {
if (e.key == "e" && location.protocol == "file:") {
editPage(sandpointsPageId)
} else if (e.key == "E" && location.protocol == "file:") {
let preview = document.querySelector("#preview");
if (preview.style.display == "flex") {
preview.style.display = "none";
} else {
preview.style.display = "flex";
}
console.log("preview: ", preview);
}
})
@ -80,7 +88,6 @@ window.addEventListener("DOMContentLoaded", (e) => {
}
document.querySelectorAll('.triadlink').forEach((i) => {
console.log(i)
i.addEventListener("click", (ev) => {
if (ev.ctrlKey) {
ev.preventDefault()

Loading…
Cancel
Save