Skip to content

Instantly share code, notes, and snippets.

@amotoki
Last active August 29, 2015 14:02
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 amotoki/5469a541d6d9543b3bcb to your computer and use it in GitHub Desktop.
Save amotoki/5469a541d6d9543b3bcb to your computer and use it in GitHub Desktop.
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