Created
August 15, 2013 02:09
-
-
Save kennyp/6237628 to your computer and use it in GitHub Desktop.
LGTM button for pull requests.
This file contains 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 LGTM Button | |
// @namespace lgtm.github.com | |
// @description Add a LGTM button to pull requests. | |
// @include https://github.com/Skookum/*/pull/* | |
// @version 1 | |
// ==/UserScript== | |
var lgtmButton = document.createElement('button'), | |
buttonCont = document.querySelector('button[name="comment_and_close"]').parentNode, | |
commentBtn = buttonCont.querySelector('button:last-child'); | |
lgtmButton.innerHTML = "LGTM"; | |
lgtmButton.setAttribute('class', 'button primary'); | |
lgtmButton.onclick = function (e) { | |
buttonCont.parentNode.querySelector('textarea:last-of-type').innerHTML = "LGTM"; | |
window.location.reload(); | |
}; | |
buttonCont.appendChild(lgtmButton); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment