mirror of https://github.com/raftario/filite.git
Random URL generation
This commit is contained in:
parent
aa77707c21
commit
f9fda22141
|
@ -31,6 +31,10 @@ const inputs = {
|
|||
],
|
||||
};
|
||||
|
||||
const randomUrl = () => {
|
||||
return Math.floor(Math.random() * 2147483647).toString(36);
|
||||
}
|
||||
|
||||
for (const group in tabs) {
|
||||
tabs[group][0].onclick = () => {
|
||||
const active = document.querySelectorAll(".active");
|
||||
|
@ -65,6 +69,13 @@ for (const group in inputs) {
|
|||
urlInput.setCustomValidity("");
|
||||
}
|
||||
});
|
||||
urlInput.addEventListener("keyup", (e) => {
|
||||
if (e.code === "Space") {
|
||||
urlInput.value = randomUrl();
|
||||
checkValidity();
|
||||
e.preventDefault();
|
||||
}
|
||||
});
|
||||
|
||||
for (const input of inputs[group].filter(
|
||||
(input) =>
|
||||
|
|
Loading…
Reference in New Issue