Collapse file diffs for files with a certain exentions. The list of extensions is on the end of gist.
Last active
January 12, 2016 13:01
-
-
Save klaascuvelier/d280eb91c393debbb597 to your computer and use it in GitHub Desktop.
Collapse diffs for certain file extensions in a PR
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
// The ES5 version, add extensions in the array at the end of the gist | |
(function (extensions) { return [].concat(Array.prototype.slice.call(document.querySelectorAll('.file.js-details-container'))).filter(function (item) { return extensions.indexOf(item.querySelector('.file-header .file-info .js-selectable-text').innerHTML.split('.').pop().toLowerCase().trim()) > -1; }).forEach(function (item) { return item.querySelector('.data').style.display = 'none'; }); })(['php']); |
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
// Needs ES6, add extensions in the array at the end of the gist | |
((extensions) => [...document.querySelectorAll('.file.js-details-container')].filter((item) => { | |
return extensions.indexOf(item.querySelector('.file-header .file-info .js-selectable-text').innerHTML.split('.').pop().toLowerCase().trim()) > -1; | |
}).forEach((item) => item.querySelector('.data').style.display = 'none'))(['php']); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
GitHub changed
.js-selectable-text
to.user-select-contain