Last active
February 13, 2018 19:55
-
-
Save tifletcher/58a57a9de2b09199334518ee0451e368 to your computer and use it in GitHub Desktop.
Bookmarklet: Hide files by regex(pathname) during github code review.
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(){ | |
var hideIfMatches = (matcher) => (node) => { | |
if(node.querySelector(".file-header").getAttribute("data-path").match(matcher)) | |
node.style.display = "none" | |
} | |
var fileNodes = document.querySelectorAll("#files .file") | |
var matcher = RegExp(prompt("Hide files when path matches regex:", "^reference.*")) | |
fileNodes.forEach(hideIfMatches(matcher)) | |
})() | |
// bookmarklet | |
// javascript:(function(){var hideIfMatches = (matcher) => (node) => {if(node.querySelector(".file-header").getAttribute("data-path").match(matcher)){node.style.display = "none";}};var fileNodes = document.querySelectorAll("#files .file");var matcher = RegExp(prompt("Hide files when path matches regex:", "^reference.*")); fileNodes.forEach(hideIfMatches(matcher));})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment