Skip to content

Commit 72af4bb

Browse files
committed
fix #1: determine user name from url
1 parent 4bbb78c commit 72af4bb

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

Diff for: .gitignore

+1-1
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

Diff for: coderstats/coderstats.js

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1-
var nick = $('em[itemprop="additionalName"]').text();// assume user page
2-
var url='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+
var path = document.location.pathname;
2+
if (m = path.match(/^\/([\w-]+)\??.*?/)) {
3+
var nick = m[1];
4+
var url='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+
}

Diff for: coderstats/manifest.json

+3-3
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)