Created
September 24, 2018 19:09
-
-
Save bwjohnson-ss/4acb8913e20fcb9f8968da6c805a1f84 to your computer and use it in GitHub Desktop.
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
// ==UserScript== | |
// @name Bamboo HR Employee Name Quiz | |
// @namespace https://bamboohr.com/employee_quiz | |
// @version 0.3.0 | |
// @description Lets you check your memory for who is who in your company. | |
// @author Ben Johnson | |
// @match https://*.bamboohr.com/employees/directory.php | |
// @grant none | |
// ==/UserScript== | |
function applyStyles() { | |
// Initialize all the names to hidden (via changing the text to white) | |
$('.JobInfo__name, .JobInfo__name a').css('color', 'white'); | |
// Always hide the email address, as this could give you too much of a hint | |
$('.ContactInfo').hide() | |
// On hover in, show the name, and then rehide on hover out | |
$('.JobInfo__name, .JobInfo__name a').hover( | |
function(){ $(this).css('color', 'black');}, | |
function(){ $(this).css('color', 'white');} | |
); | |
// Hide the Group Headers which contain the first letter of the last name | |
// of the employee, since this gives too much of a hint for the person | |
$('div.GroupHeader').hide(); | |
} | |
(function() { | |
// Sleep to allow time for all employees to load | |
setTimeout(applyStyles, 1000); | |
})(); | |
// On every scroll event, reapply the styles. I'm not exactly sure why this | |
// is required, but it probably has to do with some fancy javascript for loading | |
// that they're using on the site. This is no doubt a pretty big hack, but it | |
// doesn't seem to cause any performance issues and is probably good enough for now. | |
$(window).scroll(function() { | |
applyStyles(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment