Permalink
Browse files

Replacing links when sharing a tweet. Fixes #366

  • Loading branch information...
1 parent 8e2cd81 commit 40e8929c872cbb40d24ffcde1920cc2700735807 @cezarsa committed Oct 12, 2012
Showing with 8 additions and 0 deletions.
  1. +8 −0 lib/popup/composer.js
View
@@ -50,6 +50,14 @@ var Composer = {
var el = $("#compose_tweet_area textarea");
var user = $(".user", node).attr('screen_name');
var msg = $(".text", node).text();
+ $(".text a", node).each(function() {
+ var linkHref = $(this).attr('href'),
+ linkText = $(this).text();
+ if (linkHref && linkHref !== '#') {
+ msg = msg.replace(linkText, linkHref);
+ }
+ });
+
el.val("RT @" + user + ": " + msg);
Composer.textareaChanged();
},

0 comments on commit 40e8929

Please sign in to comment.