Skip to content

Instantly share code, notes, and snippets.

@unwiredben
Created July 11, 2012 06:00
Show Gist options
  • Save unwiredben/3088264 to your computer and use it in GitHub Desktop.
Save unwiredben/3088264 to your computer and use it in GitHub Desktop.
Add Reviewed By Userscript
// ==UserScript==
// @name add-reviewed-by-to-github
// @namespace net.combee
// @include https://github.com/*/pull/*
// @version 1
// ==/UserScript==
/*global jQuery */
/*jslint browser: true */
var main = function() {
'use strict';
jQuery('.btn-merge-pull-request').click(function() {
setTimeout(function() {
var b = jQuery("<span class='minibutton blue'>Reviewed-By</a>")
.click(function() {
var e = jQuery('.commit-preview textarea');
e.val(e.val() + "\n\nReviewed-By: Ben Combee (ben.combee@palm.com)");
});
jQuery('.merge-form .btn-cancel').after(b);
}, 10);
});
};
// Inject our main script
var script = document.createElement('script');
script.textContent = '(' + main.toString() + ')();';
document.body.appendChild(script);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment