summaryrefslogtreecommitdiff
path: root/sysret.org/themes/tabi-lean/static/js/codeBlockNameLinks.min.js
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--sysret.org/themes/tabi-lean/static/js/codeBlockNameLinks.min.js1
1 files changed, 1 insertions, 0 deletions
diff --git a/sysret.org/themes/tabi-lean/static/js/codeBlockNameLinks.min.js b/sysret.org/themes/tabi-lean/static/js/codeBlockNameLinks.min.js
new file mode 100644
index 0000000..df1f999
--- /dev/null
+++ b/sysret.org/themes/tabi-lean/static/js/codeBlockNameLinks.min.js
@@ -0,0 +1 @@
+document.addEventListener("DOMContentLoaded",function(){document.querySelectorAll("code[data-name]").forEach(function(e){var t,a=e.getAttribute("data-name");a.startsWith("http")&&((t=document.createElement("a")).href=a,t.className="source-path",t.textContent=a,e.insertBefore(t,e.firstChild),e.removeAttribute("data-name"),e.parentElement?.removeAttribute("data-name"))}),document.querySelectorAll(".code-source").forEach(function(e){var t,a=e.getAttribute("data-source");"PRE"===(e=e.nextElementSibling)?.tagName&&(e=e.querySelector("code"))&&(a.startsWith("http")?((t=document.createElement("a")).href=a,t.className="source-path",t.textContent=a,e.insertBefore(t,e.firstChild)):e.setAttribute("data-name",a))})});