From a180b95f60314872e4498bfcf56fc8fb5c34b521 Mon Sep 17 00:00:00 2001 From: Marshall Lochbaum Date: Thu, 20 Jan 2022 08:24:35 -0500 Subject: Make primitives in explain output clickable --- docs/repl.js | 4 +++- docs/style.css | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'docs') 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+''+h+''; + 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; -- cgit v1.2.3