diff -r cbb17aa3361c -r b7aa28af2c10 src/js/utils.js
--- a/src/js/utils.js Mon Nov 21 10:17:54 2011 +0100
+++ b/src/js/utils.js Mon Nov 21 10:51:22 2011 +0100
@@ -47,7 +47,18 @@
var seconds = parseFloat(Math.abs(secs % 60).toFixed(0));
return {"hours" : hours, "minutes" : minutes, "seconds" : seconds};
-}
+};
+
+/* format a tweet - replaces @name by a link to the profile, #hashtag, etc. */
+IriSP.formatTweet = function(tweet) {
+ var rNickname = /@(\w+)/; // matches a @handle
+ var rHashtag = /#(\w+)/; // matches a hashtag
+ var i1 = tweet.replace(rNickname, "@$1");
+ var i2 = i1.replace(rHashtag, "#$1");
+
+ return i2;
+};
+
/* for ie compatibility
if (Object.prototype.__defineGetter__&&!Object.defineProperty) {
Object.defineProperty=function(obj,prop,desc) {