githubpoints/githubpoints-projects.js

16 lines
524 B
JavaScript
Raw Normal View History

window.onload = function () {
var calculateIssuePoints = function {
document.getElementsByClassName.forEach(function(link) {
let points_mark = link.text.match(/^\(\d+\)*/);
if (points) {
let points = points_mark[0].replace(/\(\)/g, '');
link.text = link.text.replace(/^\(\d+\)/, '<span class="issue-points" style="background-color: #eef;">' + points + '</span>');
}
});
};
var updatePoints = function () {
calculateIssuePoints();
};
setTimeout(2000, updatePoints);
};