Last active
April 20, 2018 13:37
-
-
Save kasperg/24a13d1b2890f96010284a5fa47631ae to your computer and use it in GitHub Desktop.
Ding2 improved GitHub 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 Ding2 improved GitHub pull requests | |
// @namespace https://github.com/ding2 | |
// @include https://github.com/ding2/*/pull/* | |
// @require https://cdn.rawgit.com/jfriend00/docReady/1879d8d84c9a697792958af65be7c115079671a1/docready.js | |
// @version 1 | |
// ==/UserScript== | |
var commentExpander = function() { | |
document.querySelectorAll('.outdated-comment').forEach(function (element) { | |
element.classList.add('open'); | |
}); | |
}; | |
var commentHider = function() { | |
document.querySelectorAll('.review-comments').forEach(function (element) { | |
if (element.querySelectorAll('.has-reactions').length > 0) { | |
element.style.opacity = 0.25; | |
} | |
}); | |
}; | |
var ajaxLoader = function() { | |
var loaders = document.querySelectorAll('.ajax-pagination-btn'); | |
if (loaders.length > 0) { | |
document.querySelectorAll('.ajax-pagination-btn').forEach(function (element) { | |
element.click(); | |
}); | |
window.setTimeout(ajaxLoader, 5000); | |
} | |
commentExpander(); | |
commentHider(); | |
}; | |
docReady(ajaxLoader); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment