Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 13825bd

Browse files
committed
Fix #5: Append CoderStats link rather than cloning posibly non-existing link item.
1 parent a28676d commit 13825bd

6 files changed

+9
-8
lines changed

Screenshot_Coderstats_yaph.png

48.5 KB
Loading

Screenshot_Coderstats_yaph.xcf

168 KB
Binary file not shown.

Screenshot_Github_Coderstats_yaph.png

899 Bytes
Loading

Screenshot_Github_Coderstats_yaph.xcf

-10.6 KB
Binary file not shown.

coderstats/coderstats.js

+8-7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
var link = document.getElementsByClassName('octicon-link')[0],
2-
path = document.location.pathname,
1+
var path = document.location.pathname,
32
details,
43
login,
54
url;
@@ -26,14 +25,16 @@ function addLink() {
2625
li.setAttribute('class', 'vcard-detail pt-1');
2726
li.setAttribute('itemprop', 'url');
2827

29-
var a = document.createElement('a');
28+
let span = document.createElement('span');
29+
span.setAttribute('class', 'octicon');
30+
span.setAttribute('style', 'margin-top:-2px;');
31+
span.textContent = "📊";
32+
li.appendChild(span)
33+
34+
let a = document.createElement('a');
3035
a.setAttribute('href', url);
3136
a.textContent = "CoderStats('" + login + "')";
3237

33-
var svg = link.cloneNode();
34-
svg.appendChild(link.childNodes[0].cloneNode())
35-
36-
li.appendChild(svg);
3738
li.appendChild(a);
3839
details[0].appendChild(li);
3940
}

coderstats/manifest.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"manifest_version": 2,
3-
"version": "1.16",
3+
"version": "1.17",
44
"name": "CoderStats link for Github Coders",
55
"description": "Display a link to the CoderStats page for the currently displayed GitHub user when browsing github.com.",
66
"icons": {

0 commit comments

Comments
 (0)