aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarshall Lochbaum <mwlochbaum@gmail.com>2022-01-20 08:24:35 -0500
committerMarshall Lochbaum <mwlochbaum@gmail.com>2022-01-20 08:24:35 -0500
commita180b95f60314872e4498bfcf56fc8fb5c34b521 (patch)
tree0b6b03687a2fb9e37f26275bba7b39d57bc1dfaa
parent2657f747a1cbc740b2432f6c60b19bc6c245f8cc (diff)
Make primitives in explain output clickable
-rw-r--r--docs/repl.js4
-rw-r--r--docs/style.css1
2 files changed, 4 insertions, 1 deletions
diff --git a/docs/repl.js b/docs/repl.js
index c3dbe1e2..6ed4f725 100644
--- a/docs/repl.js
+++ b/docs/repl.js
@@ -54,9 +54,11 @@ if (doc.doexplain) doc.doexplain.onclick = () => {
e.innerHTML = s?drawEval(s,c).map(l=>l.join("")).join("\n"):'';
setTimeout(() => {
e.querySelectorAll('tspan').forEach(t => {
- let h = primhelp[t.textContent];
+ let c = t.textContent, h = primhelp[c];
if (!h) return;
t.innerHTML = t.textContent+'<title>'+h+'</title>';
+ t.classList.add('clickable');
+ t.onclick = ev => { window.open('help/'+helpurl[c]+'.html'); }
});
}, 0);
}
diff --git a/docs/style.css b/docs/style.css
index 0aa2bc7a..78344eab 100644
--- a/docs/style.css
+++ b/docs/style.css
@@ -151,6 +151,7 @@ textarea { width: 100%; outline: none; resize: vertical; margin: 0; }
fill: #272e30;
cursor: pointer;
}
+.clickable { cursor: pointer; }
.replLink {
float: right;