Last active
October 25, 2016 10:05
-
-
Save kolyuchiy/17611ac0d022be45c633 to your computer and use it in GitHub Desktop.
Tampermonkey script for 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
// ==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