From 45a15cd972ba26b8761d19c26a60a2a6aa40d901 Mon Sep 17 00:00:00 2001 From: NumEricR <-> Date: Sat, 11 Jun 2011 11:59:33 +0200 Subject: [PATCH] Fixed url on commit link --- github-commit-badge.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/github-commit-badge.js b/github-commit-badge.js index ad88625..a35b1e1 100644 --- a/github-commit-badge.js +++ b/github-commit-badge.js @@ -36,7 +36,7 @@ jQuery.getJSON("http://github.com/api/v1/json/" + badgeData["username"] + "/" + var added = myEval.commit.added || []; var modified = myEval.commit.modified || []; var removed = myEval.commit.removed || []; - + var githubUrl = 'http://github.com'; // outline-class is used for the badge with the border var myBadge = document.createElement("div"); @@ -47,7 +47,7 @@ jQuery.getJSON("http://github.com/api/v1/json/" + badgeData["username"] + "/" + myUserRepo.setAttribute("class","github-commit-badge-username"); var myLink = document.createElement("a"); - myLink.setAttribute("href","http://github.com/" + myUser + "/" + myRepo); + myLink.setAttribute("href",githubUrl + "/" + myUser + "/" + myRepo); myLink.setAttribute("class","github-commit-badge-username"); myLink.appendChild(document.createTextNode(myUser + "/" + myRepo)); myUserRepo.appendChild(myLink); @@ -64,7 +64,7 @@ jQuery.getJSON("http://github.com/api/v1/json/" + badgeData["username"] + "/" + myDiffLine.appendChild(myImage); var myLink = document.createElement("a"); - myLink.setAttribute("href",myEval.commit.url); + myLink.setAttribute("href",githubUrl + myEval.commit.url); myLink.setAttribute("class", "github-commit-badge-badge"); myLink.appendChild(document.createTextNode(" " + truncate(myEval.commit.id,10,""))); myDiffLine.appendChild(document.createTextNode(myEval.commit.committer.name + " committed "));