Skip to content

Instantly share code, notes, and snippets.

@kolyuchiy
Last active October 25, 2016 10:05
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 kolyuchiy/17611ac0d022be45c633 to your computer and use it in GitHub Desktop.
Save kolyuchiy/17611ac0d022be45c633 to your computer and use it in GitHub Desktop.
Tampermonkey script for gerrit
// ==UserScript==
// @name Gerrit code CSS
// @namespace https://gist.github.com/kolyuchiy/17611ac0d022be45c633
// @version 0.1
// @description enter something useful
// @author You
// @match http://johann.mail.msk:8081/
// @grant none
// ==/UserScript==
(function () {
var addGlobalStyle = function(css) {
var head, style;
head = document.getElementsByTagName('head')[0];
if (!head) { return; }
style = document.createElement('style');
style.type = 'text/css';
style.innerHTML = css;
head.appendChild(style);
};
var removeVeryLongError = function(els) {
if (els.length > 0 && els[0].textContent.match(/400 cannot create query for index/)) {
els[0].textContent = "Ошибка :(";
}
};
setTimeout(function () {
addGlobalStyle(".CodeMirror pre { font-family: 'Ubuntu Mono' !important }");
addGlobalStyle(".com-google-gwtexpui-safehtml-client-SafeHtmlCss-wikiPreFormat { font-family: 'Ubuntu Mono' !important }");
addGlobalStyle(".com-google-gerrit-client-change-CommitBox_BinderImpl_GenCss_style-text { font-family: 'Ubuntu Mono' !important }");
}, 1000);
setInterval(function () {
removeVeryLongError(document.getElementsByClassName('com-google-gerrit-client-change-RelatedChanges-RelatedChangesCss-tabPanel'));
}, 1000);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment