Created
October 10, 2019 18:02
-
-
Save himedlooff/78512978a324ae6c40c701016e958f9b to your computer and use it in GitHub Desktop.
When you have a lot of files to mark as viewed and you don't want to click them all...
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
function clickFileViewedViaRegex(regex, markAsViewed = true) { | |
document.querySelectorAll('.file').forEach((item) => { | |
if (item.querySelector('.file-header a[title]').getAttribute('title').match(regex)) { | |
var checkbox = item.querySelector('.js-reviewed-checkbox'); | |
if (markAsViewed && !checkbox.checked) checkbox.click(); | |
if (!markAsViewed && checkbox.checked) checkbox.click(); | |
} | |
}); | |
} | |
// example | |
// clickFileViewedViaRegex(/my-folder\/[a-z-]+\.css/, true); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment