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

Commit72af4bb

Browse files
committed
fix#1: determine user name from url
1 parent4bbb78c commit72af4bb

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

‎.gitignore‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
coderstats/vendor/*
22
*.zip
3-
promo_small.png
3+
promo_small.png

‎coderstats/coderstats.js‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1-
varnick=$('em[itemprop="additionalName"]').text();// assume user page
2-
varurl='http://coderstats.geeksta.net/coder/'+$.trim(nick);$('.details').append('<dl><dt><span class="mini-icon mini-icon-link"></span></dt><dd><a href="'+url+'">Coderstats</a></dd></dl>');
3-
1+
varpath=document.location.pathname;
2+
if(m=path.match(/^\/([\w-]+)\??.*?/)){
3+
varnick=m[1];
4+
varurl='http://cs.geeksta.net/github/'+$.trim(nick);$('.details').append('<dl><dt><span class="mini-icon mini-icon-link"></span></dt><dd><a href="'+url+'">Coderstats</a></dd></dl>');
5+
}

‎coderstats/manifest.json‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"manifest_version":2,
3-
"version":"1.5",
3+
"version":"1.6",
44
"name":"Coderstats link for Github",
55
"description":"Display a link to the Coderstats page for the currently displayed user on github.com.",
66
"icons": {
@@ -9,7 +9,7 @@
99
},
1010
"content_scripts": [{
1111
"matches": ["https://github.com/*"],
12-
"js": ["vendor/jquery-1.8.1.min.js","coderstats.js"],
12+
"js": ["vendor/jquery-2.0.0.min.js","coderstats.js"],
1313
"run_at":"document_end"
1414
}]
15-
}
15+
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp