Skip to content

Commit

Permalink
make ctl-a only grab the output
Browse files Browse the repository at this point in the history
Signed-off-by: Doug Davis <[email protected]>
  • Loading branch information
duglin committed Dec 27, 2024
1 parent 39f6930 commit caf6578
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions registry/httpStuff.go
Original file line number Diff line number Diff line change
Expand Up @@ -613,6 +613,7 @@ func (pw *PageWriter) Done() {
list-style-type: circle ;
}
</style>
<body onkeydown=dokeydown(event)>
<div id=left>
<b>Registry:</b>
<select onchange="changeRegistry(value)">`+list+` </select>
Expand Down Expand Up @@ -692,6 +693,17 @@ function toggleExp(elem, exp) {
document.getElementById(id+'dots').style.display = (exp?"none":"inline")
}
function dokeydown(event) {
if (event.key == "a" && (event.ctrlKey || event.metaKey)) {
// make ctl-a only select the output, not the entire page
event.preventDefault();
var range = document.createRange()
range.selectNodeContents(document.getElementById("text"))
window.getSelection().removeAllRanges()
window.getSelection().addRange(range)
}
}
</script>
<div id=right>
Expand All @@ -710,6 +722,8 @@ function toggleExp(elem, exp) {
<span class=expandBtn title="Expand all" onclick=toggleExp(null,true)>`+HTML_EXP+`</span>
</div><div id='text'>%s</div></div> <!--myOutput-->
</div> <!--right-->
</body>
</html>
`, RegHTMLify(pw.Info.OriginalRequest, buf))))

Expand Down

0 comments on commit caf6578

Please sign in to comment.