Skip to content

Instantly share code, notes, and snippets.

@mdaniel
Created October 10, 2013 23:52
Show Gist options
  • Save mdaniel/6927519 to your computer and use it in GitHub Desktop.
Save mdaniel/6927519 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name Relocate the Close button away from its Comment friend
// @namespace http://greasemonkey.matthewdaniel.com/
// @version 0.2
// @description Just like the name says
// @match https://github.com/*/pull/*
// @include https://github.com/*/pull/*
// @match http://github.com/*/pull/*
// @include http://github.com/*/pull/*
// ==/UserScript==
window.setTimeout(function () {
var d = document;//shorten the typing
var SCRIPT_ID = 'GitHubPullButtonFix';
function my_log(msg) {
if (console && 'log' in console) {
console.log(SCRIPT_ID+':'+msg);
}
}
var closeBtn = d.querySelector('button[name=comment_and_close]');
if (!closeBtn) {
my_log('Unable to find Close button; exiting');
return;
}
// closeBtn.style.background = 'red';
closeBtn.style.marginRight = '300px';
/*
I thought I could relocate the tip in between them, but no.
var closeParent = closeBtn.parentNode;
var commentBtn = closeParent.querySelector('button.primary');
var tipDiv = closeParent.querySelector('div.tip');
closeParent.removeChild( tipDiv );
closeParent.insertBefore( tipDiv, commentBtn );
*/
// give the page time to heat up
}, 2000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment