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

Skip to content

Commit b72b97f

Browse files
committed
make ext work on both user and organization pages which have different markup on Github
1 parent 603adc2 commit b72b97f

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

coderstats/README

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
DESCRIPTION
2-
The Coderstats link for Github Chrome extension displays a link to the Coderstats page for the currently display user profile page on http://github.com.
2+
The Coderstats link for Github Chrome extension displays a link to the Coderstats page for the currently displayed user profile page on http://github.com.

coderstats/coderstats.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1-
var url='http://coderstats.geeksta.net/coder/'+$('span[itemprop="nickname"]').text();$('.page-profile .vcard').append('<dl><dt>Coderstats</dt><dd><a href="'+url+'">'+url+'</a></dd></dl>');
1+
var nick = $('span[itemprop]="nickname"').text();// assume user page
2+
if (!nick) nick = $('.pagehead.userpage').attr('data-name');// org page
3+
var url='http://coderstats.geeksta.net/coder/'+$.trim(nick);$('.page-profile .vcard').append('<dl><dt>Coderstats</dt><dd><a href="'+url+'">'+url+'</a></dd></dl>');
24

coderstats/manifest.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "Coderstats link for Github",
3-
"version": "1.1",
3+
"version": "1.2",
44
"description": "Display a link to the Coderstats page for the currently displayed user on github.com.",
55
"icons":
66
{

0 commit comments

Comments
 (0)