Skip to content

Instantly share code, notes, and snippets.

@soter19
Last active January 15, 2018 21:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save soter19/c4703874d6454d18a6a0a3ce83448707 to your computer and use it in GitHub Desktop.
Save soter19/c4703874d6454d18a6a0a3ce83448707 to your computer and use it in GitHub Desktop.
Bitbucket PR file filter
// 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