-
-
Save KronicDeth/06e035180da2df1d3d50bb9f5a0dcd0f to your computer and use it in GitHub Desktop.
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
<script> | |
function colorCodeTags(){ | |
var cells = document.getElementsByTagName("td");// finding all the TD tags | |
for (var cell of cells) { | |
if (!cell.classList.contains("ms-vb-title")) { | |
const innerText = cell.innerText | |
switch (cell.innerText) { | |
case "Blue": | |
cell.innerHTML = "<style>img {height: 20px; width: 20px; display: block; margin-left: auto; margin-right: auto; }</style><img src = 'https://collaboration.merck.com/sites/ngppm-uat/Style%20Library/Images/blue.png'/>"; | |
break; | |
case "Green": | |
cell.innerHTML = "<style>img {height: 20px; width: 20px; display: block; margin-left: auto; margin-right: auto; }</style><img src = 'https://collaboration.merck.com/sites/ngppm-uat/Style%20Library/Images/Green.png'/>"; | |
break; | |
case "Yellow": | |
cell.innerHTML = "<style>img {height: 20px; width: 20px; display: block; margin-left: auto; margin-right: auto; }</style><img src = 'https://collaboration.merck.com/sites/ngppm-uat/Style%20Library/Images/Yellow.png'/>"; | |
break; | |
case "Red": | |
cell.innerHTML = "<style>img {height: 20px; width: 20px; display: block; margin-left: auto; margin-right: auto; }</style><img src = 'https://collaboration.merck.com/sites/ngppm-uat/Style%20Library/Images/Red.png'/>"; | |
break; | |
} | |
} | |
} | |
} | |
setInterval(colorCodeTags, 100); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment