Last active
August 29, 2015 14:02
-
-
Save amotoki/5469a541d6d9543b3bcb to your computer and use it in GitHub Desktop.
Bookmarklet to hide CI comments in OpenStack Gerrit
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
javascript:(function(){ | |
/* Bookmarklet maker: http://userjs.up.seesaa.net/js/bookmarklet.html */ | |
/* Configuraitons */ | |
me = 'Akihiro Motoki'; | |
ci_hide = true; | |
fail_hide = false; | |
/* main code */ | |
list = document.querySelectorAll('table.commentPanelHeader'); | |
for(i in list) { | |
title = list[i]; | |
if(! title.innerHTML) { continue; } | |
text = title.nextSibling; | |
if (title.innerHTML.search(me) >= 0) { | |
title.style.color='blue'; | |
} else if (text.innerHTML.search('Build failed') > 0) { | |
title.style.color='red'; | |
title.parentNode.hidden = fail_hide; | |
} else if(title.innerHTML.search('Jenkins| CI|Ryu|Testing|Mine|LaunchpadSync|Elastic Recheck') >= 0) { | |
title.style.color='#666666'; | |
title.parentNode.hidden = ci_hide; | |
} else { | |
title.style.color='green'; | |
} | |
} | |
})() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment