msparks/libgithub — pull request #2 by jbenet (2012-02-13 20:39:15+00:00)
Title: added repoLink attribute to ActivityLine

I wanted to be able to show the repo URL on the line itself (without having to manually construct it myself). To show something like:

github.com/jbenet/datastore: jbenet committed c65ec6feb4 about 2 months ago

I implemented this by adding a repoLink attribute to ActivityLine. It defaults to null (no behavior change). If it is set to true (or truthy but not a function):

myActivityLine.repoLinkIs(true);

it adds the repo link with a colon (as above). If it is a function, it will be called, letting the client transform the repo link text, to do things like:

al.repoLinkIs(function(link) {
return $('span').append(link).append(' activity: ');
});

to yield:

github.com/jbenet/datastore activity: jbenet committed c65ec6feb4 about 2 months ago

cheers :)

PS: <3 the cheritonian convention! (though js's getter/setter overloading (as in jquery's) is probably expected by other users).