Last active
January 15, 2018 21:34
-
-
Save soter19/c4703874d6454d18a6a0a3ce83448707 to your computer and use it in GitHub Desktop.
Bitbucket PR file filter
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
// Ask for file extension(s) | |
var fileTypes = prompt('Insira os tipos de arquivo que você quer que sejam escondidos, separados por vírgula').trim().split(',') | |
// Hide all Files | |
var allFiles = $('section').filter((index,el)=>el.id.indexOf('chg') > -1).each((i,el)=>el.style.display = 'none') | |
var count = 0 | |
// Only show files that don't have the chosen extensions | |
allFiles.map((index,el)=>{ | |
fileTypes.map(fileExtension => { | |
if (el.id.indexOf(fileExtension) === -1) { | |
count++ | |
if (fileTypes.length === count) { | |
el.style.display = 'block' | |
count = 0 | |
} | |
} | |
} | |
) | |
count = 0 | |
} | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment