diff options
-rw-r--r-- | cmd/monfront/main.go | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/cmd/monfront/main.go b/cmd/monfront/main.go index 3445942..8518bd4 100644 --- a/cmd/monfront/main.go +++ b/cmd/monfront/main.go @@ -568,8 +568,6 @@ var ( #mainmenu a:hover, #mainmenu a:active { color: #eeeeee; } #mainmenu ul ul a { margin-left: 0.5em; } #mainmenu form * { display: block; margin: 0.25em 0.5em; } - #mainmenu form input { } - #mainmenu form button { } form section { display: flex; flex-direction: row; @@ -638,7 +636,26 @@ var ( </ul> </nav> {{ if .Error }}<div class="error">{{ .Error }}</div>{{ end }}`, - "footer": `</body></html>`, + "footer": `<script> + function select_row(event) { + if (event.target.nodeName == 'INPUT') { + return; + } + for (i = 0; i < event.path.length; i++) { + if (event.path[i].nodeName != 'TR') { + continue; + } + e = event.path[i].children[0].children[0]; + e.checked = !e.checked; + e.focus(); + break; + } + } + + els = document.getElementsByTagName('tr'); + for (i = 0; i < els.length; i++) { + els[i].addEventListener('click', {handleEvent: select_row}); + }</script></body></html>`, "checklist": `{{ template "header" . }} <form method="post" action="/action"> <section> |