From 82ecd61f5c699cf3af6c4eadf47a1c52b1d696c6 Mon Sep 17 00:00:00 2001 From: Aspen Smith Date: Sun, 11 Feb 2024 22:00:40 -0500 Subject: chore(users): grfn -> aspen Change-Id: I6c6847fac56f0a9a1a2209792e00a3aec5e672b9 Reviewed-on: https://cl.tvl.fyi/c/depot/+/10809 Autosubmit: aspen Reviewed-by: sterni Tested-by: BuildkiteCI Reviewed-by: lukegb --- users/grfn/bbbg/resources/public/main.js | 73 -------------------------------- 1 file changed, 73 deletions(-) delete mode 100644 users/grfn/bbbg/resources/public/main.js (limited to 'users/grfn/bbbg/resources/public/main.js') diff --git a/users/grfn/bbbg/resources/public/main.js b/users/grfn/bbbg/resources/public/main.js deleted file mode 100644 index 87c0b64d0a37..000000000000 --- a/users/grfn/bbbg/resources/public/main.js +++ /dev/null @@ -1,73 +0,0 @@ -window.onload = () => { - const input = document.getElementById("name-autocomplete"); - if (input != null) { - const attendeeList = document.getElementById("attendees-list"); - const filterAttendees = (filter) => { - if (filter == "") { - for (let elt of attendeeList.querySelectorAll("li")) { - elt.classList.remove("hidden"); - } - - return; - } - - let re = ""; - for (let c of filter) { - re += `${c}.*`; - } - let filterRe = new RegExp(re, "i"); - - for (let elt of attendeeList.querySelectorAll("li")) { - const attendee = JSON.parse(elt.dataset.attendee); - if (attendee["bbbg.attendee/meetup-name"].match(filterRe) == null) { - elt.classList.add("hidden"); - } else { - elt.classList.remove("hidden"); - } - } - }; - - const attendeeIDInput = document.getElementById("attendee-id"); - const submit = document.querySelector("#submit-button"); - const signupForm = document.getElementById("signup-form"); - - input.oninput = (e) => { - filterAttendees(e.target.value); - attendeeIDInput.value = null; - submit.classList.add("hidden"); - submit.setAttribute("disabled", "disabled"); - signupForm.setAttribute("disabled", "disabled"); - }; - - attendeeList.addEventListener("click", (e) => { - if (!(e.target instanceof HTMLLIElement)) { - return; - } - if (e.target.dataset.attendee == null) { - return; - } - - const attendee = JSON.parse(e.target.dataset.attendee); - input.value = attendee["bbbg.attendee/meetup-name"]; - attendeeIDInput.value = attendee["bbbg.attendee/id"]; - - submit.classList.remove("hidden"); - submit.removeAttribute("disabled"); - signupForm.removeAttribute("disabled"); - }); - } - - document.querySelectorAll("form").forEach((form) => { - form.addEventListener("submit", (e) => { - if (e.target.attributes.disabled) { - e.preventDefault(); - } - - const confirmMessage = e.target.dataset.confirm; - if (confirmMessage != null && !confirm(confirmMessage)) { - e.stopImmediatePropagation(); - e.preventDefault(); - } - }); - }); -}; -- cgit 1.4.1