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

Commita28676d

Browse files
committed
show coderstats link after user navigation tab is clicked
updated screenshots and added xcf files
1 parentf4f56e6 commita28676d

File tree

8 files changed

+43
-155
lines changed

8 files changed

+43
-155
lines changed

‎Screenshot_Coderstats_yaph.png‎

-10.8 KB
Loading

‎Screenshot_Coderstats_yaph.xcf‎

259 KB
Binary file not shown.
-34.9 KB
Loading
332 KB
Binary file not shown.

‎arrow.png‎

567 Bytes
Loading

‎coderstats/coderstats.js‎

Lines changed: 42 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,49 @@
1-
varpath=document.location.pathname;
1+
varlink=document.getElementsByClassName('octicon-link')[0],
2+
path=document.location.pathname,
3+
details,
4+
login,
5+
url;
6+
27
if(m=path.match(/^\/([\w-]+)\??.*?/)){
3-
varlogin=m[1];
8+
login=m[1].trim();
49
if(-1===['timeline','languages','blog','explore'].indexOf(login)){
5-
varurl='http://coderstats.net/github/'+login.trim()+'/';
6-
vardetails=document.getElementsByClassName('vcard-details');
10+
url='http://coderstats.net/github/'+login+'/';
11+
details=document.getElementsByClassName('vcard-details');
712
if(details.length>0){
8-
varlink=document.getElementsByClassName('octicon-link')[0];
13+
addLink();
14+
document.addEventListener('DOMSubtreeModified',navClick,false);
15+
}
16+
}
17+
}
918

10-
varli=document.createElement('li');
11-
li.setAttribute('class','vcard-detail pt-1');
12-
li.setAttribute('itemprop','url');
1319

14-
vara=document.createElement('a');
15-
a.setAttribute('href',url);
16-
a.textContent="CoderStats('"+login+"')";
20+
functionaddLink(){
21+
letcslink=document.getElementById('coderstats');
22+
if(cslink)return;
1723

18-
varsvg=link.cloneNode();
19-
svg.appendChild(link.childNodes[0].cloneNode())
24+
varli=document.createElement('li');
25+
li.setAttribute('id','coderstats');
26+
li.setAttribute('class','vcard-detail pt-1');
27+
li.setAttribute('itemprop','url');
2028

21-
li.appendChild(svg);
22-
li.appendChild(a);
23-
details[0].appendChild(li);
24-
}
25-
}
26-
}
29+
vara=document.createElement('a');
30+
a.setAttribute('href',url);
31+
a.textContent="CoderStats('"+login+"')";
32+
33+
varsvg=link.cloneNode();
34+
svg.appendChild(link.childNodes[0].cloneNode())
35+
36+
li.appendChild(svg);
37+
li.appendChild(a);
38+
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+
}

‎coderstats/manifest.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"manifest_version":2,
3-
"version":"1.15",
3+
"version":"1.16",
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": {

‎promo_small.svg‎

Lines changed: 0 additions & 135 deletions
This file was deleted.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp