Last active
November 2, 2018 11:06
-
-
Save stefnotch/79b88e54d0a36c1c92bdda06750b2ec3 to your computer and use it in GitHub Desktop.
Colorizes a YouTrack backlog
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
/** | |
* Open the browser console | |
* Copy paste the entire script | |
* Close the console and everything should work (until you reload the page) | |
*/ | |
//No, that's not how I usually write JS. This is pretty much the definition of: "I spent a few minutes hacking something pretty together." | |
var targetNode = document.getElementsByClassName('yt-backlog-container')[0]; | |
var colorize = () => { | |
if(!document.hasFocus()) return; | |
[...targetNode.getElementsByClassName("yt-agile-backlog-issue")] | |
.forEach(el => { | |
var color = ""; | |
[...el.getElementsByClassName("yt-issue-custom-field")] | |
.forEach(e => { | |
if(e.getElementsByTagName("span")[0].innerHTML.includes("Epic")) { color = e.style.color = "red";} | |
if(e.getElementsByTagName("span")[0].innerHTML.includes("User Story")) { color = e.style.color = "blue";} | |
if(e.getElementsByTagName("span")[0].innerHTML.includes("Task")) { color = e.style.color = "green";} | |
}); | |
if(color) { | |
el.style.boxShadow = "inset 5px 0px 0px 0px " + color; | |
} | |
}); | |
}; | |
colorize(); | |
setInterval(colorize, 1000); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Priority colorizer: