Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Bookmarklet to hide CI comments in OpenStack Gerrit
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