all repos — honk @ 11a21bad08e502e93a5e044688312148ad09b791

my fork of honk

views/misc.js (view raw)

 1function expandstuff() {
 2	var els = document.querySelectorAll(".honk details")
 3	for (var i = 0; i < els.length; i++) {
 4		els[i].open = true
 5	}
 6}
 7
 8function updatedonker(el) {
 9	el = el.parentElement
10	el.children[1].textContent = el.children[0].value.slice(-20)
11}
12
13(function() {
14	var expand = document.querySelector("button.expand")
15	if (expand) {
16		expand.onclick = expandstuff
17	}
18
19	var donk = document.querySelector("#donker input")
20	if (donk) {
21		donk.onchange = function() {
22			updatedonker(this);
23		}
24	}
25})()