Created
January 10, 2023 00:28
-
-
Save reece/14e2a155126b285d94a4b38aa964aa30 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 GitHub Pull: All open review requests button | |
// @namespace Violentmonkey Scripts | |
// @match https://github.com/pulls* | |
// @grant MIT | |
// @version 1.0 | |
// @author Reece Hart <[email protected]> | |
// @description Add button to show previously reviewed pull requests that are still open | |
// @require https://code.jquery.com/jquery-3.6.1.slim.min.js | |
// @require https://gist.github.com/raw/2625891/waitForKeyElements.js | |
// ==/UserScript== | |
function updateNavBar () { | |
console.log("Adding All open review requests button") | |
a = document.querySelector("a[title='Pull Requests requesting your review']") | |
b = a.cloneNode(true) | |
b.setAttribute("title", "All open review requests") | |
b.innerHTML = "Open review requests" | |
b.setAttribute("data-selected-links", b.getAttribute("data-selected-links").replace("review-requested", "reviewed-by")) | |
b.setAttribute("href", b.getAttribute("href").replace("review-requested", "reviewed-by")) | |
b.classList.remove("selected") | |
b.removeAttribute("aria-current") | |
a.after(b) | |
} | |
waitForKeyElements("a[title='Pull Requests requesting your review']", updateNavBar); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment