fix: minor fixes to the HTTP frontend

This commit is contained in:
meeg_leeto 2022-04-30 01:47:34 +01:00
parent 6c7b06f021
commit df0cff37af
2 changed files with 14 additions and 3 deletions

View File

@ -34,7 +34,7 @@ body {
#shortened { #shortened {
font-size: calc(min(20pt, 10vw)); font-size: calc(min(20pt, 10vw));
font-family: monospace; font-family: monospace;
color: #385d22; color: #99ff5e;
text-align: center; text-align: center;
} }

View File

@ -12,8 +12,19 @@
// Select the full link with one click // Select the full link with one click
shortened.onclick = () => { shortened.onclick = () => {
this.focus(); if (document.body.createTextRange) {
this.select(); const range = document.body.createTextRange();
range.moveToElementText(shortened);
range.select();
} else if (window.getSelection) {
const selection = window.getSelection();
const range = document.createRange();
range.selectNodeContents(shortened);
selection.removeAllRanges();
selection.addRange(range);
} else {
// Highlight unsupported
}
}; };
// Set up the actual submission // Set up the actual submission