Last active
January 31, 2021 17:07
-
-
Save adamralph/9fff802bcf5656746b2d4cde358b9797 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 GitHub checklist highlighter 595491 | |
// @version 5 | |
// @grant none | |
// @include https://github.com/* | |
// ==/UserScript== | |
(function f() { | |
var taskListItems = document.getElementsByClassName("task-list-item enabled"); | |
for (var i = 0; i < taskListItems.length; i++) { | |
if (taskListItems[i].getElementsByClassName("task-list-item-checkbox")[0].checked) { | |
taskListItems[i].style.backgroundColor = "rgba(0,255,0,0.15)"; | |
} | |
else { | |
taskListItems[i].style.backgroundColor = "rgba(255,0,0,0.15)"; | |
} | |
} | |
var formCheckboxes = document.getElementsByClassName("form-checkbox mt-0"); | |
for (var i = 0; i < formCheckboxes.length; i++) { | |
if (formCheckboxes[i].querySelectorAll('[type="checkbox"]')[0].checked) { | |
formCheckboxes[i].style.backgroundColor = "rgba(0,255,0,0.15)"; | |
} | |
else { | |
formCheckboxes[i].style.backgroundColor = "rgba(255,0,0,0.15)"; | |
} | |
} | |
setTimeout(function() { f(); }, 1e3); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment