-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
Copy pathhead.html
50 lines (38 loc) · 991 Bytes
/
head.html
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<script>
{
let timer = 0;
function showmesg(t, form) {
if (timer == 0) {
timer = new Date();
}
let tm = new Date();
if (tm - timer > 300) {
t = '------------------------------\n' + t;
}
let area = document.forms[form + 'form'].getElementsByTagName('textarea')[0];
area.value += t + '\n';
area.scrollTop = area.scrollHeight;
timer = tm;
}
function logMouse(e) {
let evt = e.type;
while (evt.length < 11) evt += ' ';
showmesg(evt + " button=" + e.button, 'test')
return false;
}
function keyval(n) {
if (n == null) return 'undefined';
let s = '' + n;
if (n >= 32 && n < 127) s += ' ' + String.fromCharCode(n);
while (s.length < 6) s += ' ';
return s;
}
function logClear(form) {
timer = 0;
document.forms[form+'form'].getElementsByTagName('textarea')[0].value ='';
lines = 0;
}
window.logClear = logClear;
window.logMouse = logMouse;
}
</script>