Skip to content

Instantly share code, notes, and snippets.

@bugaevc
Forked from anonymous/highlight.js
Last active December 2, 2015 18:53
Show Gist options
  • Save bugaevc/c3dfd00e29dd2dcef135 to your computer and use it in GitHub Desktop.
Save bugaevc/c3dfd00e29dd2dcef135 to your computer and use it in GitHub Desktop.
var highlight = "NAME GOES HERE";
(function() {
"use strict";
var rows = document.getElementsByClassName("st_team");
var found;
for(var i = 1; i < rows.length - 3; i++)
if(rows[i].innerHTML.indexOf(highlight) !== -1)
found = rows[i];
if(found === undefined)
return;
found.parentElement.style.background = "#C5C5C5"; // grey
var titleRow = rows[0].parentElement.childNodes;
var foundRow = found.parentElement.childNodes;
for(var i = 2; i < titleRow.length - 2; i++)
if(titleRow[i].innerHTML.indexOf("u") !== -1)
// up-smth
if(foundRow[i].innerHTML.indexOf("<b>") !== -1)
// bold means completed
foundRow[i].style.background = "#4CAF50"; // green
else if(foundRow[i].innerHTML.indexOf("0") !== -1)
// not completed, but tried to
foundRow[i].style.background = "#FF9800"; // orange
else
//skipped
foundRow[i].style.background = "#F44336"; // red
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment