Created
February 13, 2022 15:20
-
-
Save edemaine/3b32be8a20ceafd931c2f2a6815d3ae4 to your computer and use it in GitHub Desktop.
Enable toggling subset of users in when2meet results view
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// paste this into your browser console when looking at when2meet results | |
if (!window.OrigAvailableAtSlot) window.OrigAvailableAtSlot = AvailableAtSlot; | |
if (!window.OrigAvailableIDs) window.OrigAvailableIDs = AvailableIDs; | |
let nameFilter; | |
if (nameFilter = document.getElementById('NameFilter')) nameFilter.remove(); | |
nameFilter = document.createElement('ul'); | |
nameFilter.id = 'NameFilter'; | |
document.getElementById('LeftPanel').appendChild(nameFilter); | |
const idOn = (id) => document.getElementById(id).checked; | |
for (let i = 0; i < PeopleNames.length; i++) { | |
const li = document.createElement('li'); | |
li.innerHTML = `<input type="checkbox" id="${PeopleIDs[i]}" checked>` + | |
` <label for="${PeopleIDs[i]}">${PeopleNames[i]}</label>`; | |
nameFilter.appendChild(li); | |
li.addEventListener('change', () => { | |
AvailableIDs = OrigAvailableIDs.filter(idOn); | |
AvailableAtSlot = OrigAvailableAtSlot.map((avail) => avail.filter(idOn)); | |
ReColorGroup(); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Beautiful -- thanks!