Changed icon, added CSS and improved code readability

This commit is contained in:
José Carlos Cuevas 2019-04-15 15:12:42 +02:00
parent a02de0caf4
commit 11ddbe89f3
4 changed files with 17 additions and 3 deletions

View file

@ -5,7 +5,7 @@ var calculateIssuePoints = function () {
let points_mark = link.text.match(/^\(\d+\)*/);
if (points_mark) {
let points = points_mark[0].replace(/\(|\)/g, '');
link.innerHTML = link.text.replace(/^\(\d+\)/, '<span class="issue-points" style="background-color: #0366d6; color: #fff; padding: 0.1rem;">' + points + '</span>');
link.innerHTML = link.text.replace(/^\(\d+\)/, '<span class="issue-points">' + points + '</span>');
}
};
};
@ -25,7 +25,7 @@ var updatePoints = function () {
if (column_points.length > 0) {
column_points[0].innerHTML = total;
} else {
header.innerHTML = '<span class="column-points" style="background-color: #0366d6; color: #fff; padding: 0.1rem;">' + total + '</span>' + header.innerHTML;
header.innerHTML = '<span class="column-points">' + total + '</span>' + header.innerHTML;
}
};
};

13
githubpoints.css Normal file
View file

@ -0,0 +1,13 @@
.issue-points {
background-color: #0366d6;
color: #fff;
border-radius: 20px;
padding: 2px 5px;
}
.column-points {
background-color: #0366d6;
color: #fff;
border-radius: 20px;
padding: 2px 5px;
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 225 B

After

Width:  |  Height:  |  Size: 5.4 KiB

View file

@ -15,7 +15,8 @@
"content_scripts": [
{
"matches": ["*://*.github.com/*/projects/*"],
"js": ["githubpoints-projects.js"]
"js": ["githubpoints-projects.js"],
"css": ["githubpoints.css"]
}
]