Skip to content

Instantly share code, notes, and snippets.

@bugaevc bugaevc/highlight.js forked from anonymous/highlight.js
Last active Dec 2, 2015

Embed
What would you like to do?
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
You can’t perform that action at this time.