-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcls.aplf
35 lines (30 loc) · 1.4 KB
/
cls.aplf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
cls;html;theme
html←''
html,←'<html onmouseout="S=true" onmouseover="S=false">'
theme←config.data.(⍎theme)
html,←'<style>'
html,←'body{margin:0;background:',theme.background,';color:',theme.output,'}'
html,←'.block{margin:0;border:0.5ex solid transparent;min-height:1.4ex;padding-left:0.5ex;font-family:"APL385 Unicode";'
html,←'border-left:1ex solid ',(2⊃theme.borders),'}'
html,←'.error{color:',theme.error,'}'
html,←'.meta{border-top:none;margin-top:-0.5ex;color:',theme.meta,';border-left-color:',(3⊃theme.borders),'}'
html,←'.output:hover,.error:hover{border-left-color:',(⊃theme.borders),'}'
html,←'.box{color:#999}'
html,←'</style>'
html,←'<script>'
html,←'S=true;'
html,←'C=e=>{'
html,←' t=e.target.tagName==="SPAN"?e.target.parentNode:e.target;'
html,←' if(e.ctrlKey){'
html,←' try{document.getElementById(t.id+`x`).remove()}'
html,←' catch{t.insertAdjacentHTML(`afterend`,`<pre onclick=''R(event)'' class=''block meta'' id=''${t.id+`x`}''>${t.title}</pre>`)}'
html,←' };'
html,←' if(e.altKey){'
html,←' try{document.getElementById(t.id+`x`).remove()}'
html,←' finally{t.remove()}'
html,←' }'
html,←'};'
html,←'R=e=>{if(e.altKey||e.ctrlKey)e.target.remove()}'
html,←'</script>'
html,←'<body onclick="if(event.altKey&&event.ctrlKey)this.innerHTML=``"></body>'
hr.HTML←html