fix: minor fixes to the HTTP frontend
This commit is contained in:
parent
6c7b06f021
commit
df0cff37af
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue