Created
December 9, 2014 06:45
-
-
Save Ivanca/79d3daa0328f0546298c to your computer and use it in GitHub Desktop.
Collapse Diffs - Functionality for Github commits (UserScript/Tampermonkey/Greasemonkey)
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 Collapse diff | |
// @namespace http://no.one/ | |
// @version 0.2 | |
// @description Enter something useful | |
// @author You | |
// @match https://github.com/* | |
// @grant none | |
// ==/UserScript== | |
setInterval(function(){ | |
if (/\/commit\//.test(document.location.href)) { | |
if ($('.collapse_d').length === 0 && $('.meta').length > 0) { | |
var html = '<a href="#" class="collapse_d minibutton" rel="nofollow">Collapse</a>'; | |
$('.actions').append(html); | |
$(document.body).on('click', '.collapse_d', function(){ | |
$(this).closest('.meta').next('.data').toggle(); | |
document.activeElement.blur(); | |
return false; | |
}); | |
} | |
} | |
}, 1000) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment