Skip to content

Instantly share code, notes, and snippets.

@edemaine
Created February 13, 2022 15:20
Show Gist options
  • Save edemaine/3b32be8a20ceafd931c2f2a6815d3ae4 to your computer and use it in GitHub Desktop.
Save edemaine/3b32be8a20ceafd931c2f2a6815d3ae4 to your computer and use it in GitHub Desktop.
Enable toggling subset of users in when2meet results view
// 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>` +
`&nbsp;<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();
});
}
@CGClaypool
Copy link

Beautiful -- thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment