Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit7bc420a

Browse files
committed
Append CoderStats link rather than cloning posibly non-existing link item.
Don't listen on DOMSubtreeModified event
1 parent0ca9909 commit7bc420a

File tree

1 file changed

+9
-19
lines changed

1 file changed

+9
-19
lines changed

‎coderstats/data/coderstats.js‎

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
varlink=document.getElementsByClassName('octicon-link')[0],
2-
path=document.location.pathname,
1+
varpath=document.location.pathname,
32
details,
43
login,
54
url;
@@ -11,7 +10,6 @@ if (m = path.match(/^\/([\w-]+)\??.*?/)) {
1110
details=document.getElementsByClassName('vcard-details');
1211
if(details.length>0){
1312
addLink();
14-
document.addEventListener('DOMSubtreeModified',navClick,false);
1513
}
1614
}
1715
}
@@ -26,24 +24,16 @@ function addLink() {
2624
li.setAttribute('class','vcard-detail pt-1');
2725
li.setAttribute('itemprop','url');
2826

29-
vara=document.createElement('a');
27+
letspan=document.createElement('span');
28+
span.setAttribute('class','octicon');
29+
span.setAttribute('style','margin-top:-2px;');
30+
span.textContent="📊";
31+
li.appendChild(span)
32+
33+
leta=document.createElement('a');
3034
a.setAttribute('href',url);
3135
a.textContent="CoderStats('"+login+"')";
3236

33-
varsvg=link.cloneNode();
34-
svg.appendChild(link.childNodes[0].cloneNode())
35-
36-
li.appendChild(svg);
3737
li.appendChild(a);
3838
details[0].appendChild(li);
39-
}
40-
41-
42-
// https://github.com/KyroChi/GitHub-Profile-Fluency/blob/Google-Chrome/chrome/content.js
43-
functionnavClick(){
44-
document.removeEventListener('DOMSubtreeModified',navClick);
45-
setTimeout(function(){
46-
addLink();
47-
document.addEventListener('DOMSubtreeModified',navClick,false);
48-
},500);
49-
}
39+
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp