mirror of
https://github.com/aljazceru/CTFd.git
synced 2026-02-01 04:14:25 +01:00
5ce3003b Merge pull request #47 from aCursedComrade/patch-1 c9887cb1 Fix team template git-subtree-dir: CTFd/themes/core-beta git-subtree-split: 5ce3003b4d68352e629ee2d390bc999e7d6b071e
28 lines
763 B
JavaScript
28 lines
763 B
JavaScript
export default () => {
|
|
document.querySelectorAll(".form-control").forEach($el => {
|
|
$el.addEventListener("onfocus", () => {
|
|
$el.classList.remove("input-filled-invalid");
|
|
$el.classList.add("input-filled-valid");
|
|
});
|
|
|
|
$el.addEventListener("onblur", () => {
|
|
if ($el.nodeValue === "") {
|
|
$el.classList.remove("input-filled-valid");
|
|
$el.classList.remove("input-filled-invalid");
|
|
}
|
|
});
|
|
|
|
if ($el.nodeValue) {
|
|
$el.classList.add("input-filled-valid");
|
|
}
|
|
});
|
|
|
|
document.querySelectorAll(".page-select").forEach($el => {
|
|
if ($el.nodeValue) {
|
|
const url = new URL(window.location);
|
|
url.searchParams.set("page", $el.nodeValue);
|
|
window.location.href = url.toString();
|
|
}
|
|
});
|
|
};
|