- Install Tampermonkey Chrome or Firefox
- Click on https://gist.github.com/dz0ny/d9c9923f6166fc56ddb80aa1ce742ff2/raw/usp.user.js
- Close browser, user scripts need to load in new browser context after installation.
Last active
November 2, 2021 12:43
-
-
Save dz0ny/d9c9923f6166fc56ddb80aa1ce742ff2 to your computer and use it in GitHub Desktop.
SUM USP on GitHub Projects
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 Sum User Points | |
// @match https://github.com/orgs/niteoweb/projects/1/views/* | |
// @icon https://github.githubassets.com/favicons/favicon.svg | |
// @namespace https://github.com/orgs/niteoweb/projects/1/views | |
// @version 0.0.3 | |
// @homepageURL https://gist.github.com/dz0ny/d9c9923f6166fc56ddb80aa1ce742ff2/ | |
// @updateURL https://gist.github.com/dz0ny/d9c9923f6166fc56ddb80aa1ce742ff2/raw/usp.user.js | |
// @run-at document-end | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
function updateSUMSP(){ | |
let columnNumber = 4; | |
let header = document.querySelector(`#memex-app-root #table-portal-root + div div:first-child div:nth-child(1) grid-cell:nth-child(${columnNumber}) div span`); | |
if(!header||header.innerText.indexOf("Story Points") !== 0){ | |
return; | |
} | |
let rows = document.querySelectorAll(`#memex-app-root #table-portal-root + div div:last-child div[role='row'] div:nth-child(${columnNumber})`); | |
let sumUSP = Array.from(rows).map(el=>Number(el.innerText)).reduce((a, b) => a + b, 0); | |
header.innerHTML = `Story Points (${sumUSP})`; | |
} | |
window.addEventListener('popstate', updateSUMSP); | |
let app = document.querySelector("body"); | |
app.addEventListener("click",updateSUMSP, true); | |
app.addEventListener("mouseover",updateSUMSP, true); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment