diff --git a/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/assets/js/sandpoints.js b/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/assets/js/sandpoints.js index 1ffb04c..14d9303 100644 --- a/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/assets/js/sandpoints.js +++ b/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/assets/js/sandpoints.js @@ -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( diff --git a/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/layouts/_default/_markup/render-image.html b/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/layouts/_default/_markup/render-image.html index f1cef80..34ffe60 100644 --- a/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/layouts/_default/_markup/render-image.html +++ b/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/layouts/_default/_markup/render-image.html @@ -29,9 +29,9 @@ {{- $session := $.Page.Site.GetPage (printf "/%s" (replace .Destination ":" "/")) -}} {{ .Page.Scratch.Add "links" (slice $session) }} {{- if not $text_link -}} - {{- index (split .Destination ":") 0 -}}⁄{{- $session.Title -}} + {{- index (split .Destination ":") 0 -}}⁄{{- $session.Title -}} {{- else -}} - {{- index (split .Destination ":") 0 -}}⁄{{- $text_link -}} + {{- index (split .Destination ":") 0 -}}⁄{{- $text_link -}} {{- end -}} {{- else -}} {{- $text_link -}}⦚{{- .Destination -}} not found diff --git a/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/layouts/partials/sandpointjs.html b/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/layouts/partials/sandpointjs.html index d023ad6..ef9cf51 100644 --- a/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/layouts/partials/sandpointjs.html +++ b/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/layouts/partials/sandpointjs.html @@ -1,4 +1,4 @@ - + {{ $sjsopts := dict "targetPath" "js/sandpoints.js" "minify" "true"}} {{ $sjs := resources.Get "js/sandpoints.js" | js.Build $sjsopts }} diff --git a/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/layouts/partials/singlebody.html b/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/layouts/partials/singlebody.html index 6a7e524..712406c 100644 --- a/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/layouts/partials/singlebody.html +++ b/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/layouts/partials/singlebody.html @@ -93,3 +93,6 @@ {{ with .Page.Params.abstract }}