reply and retweet links now work. popcorn-port
authorhamidouk
Thu, 01 Dec 2011 11:40:53 +0100
branchpopcorn-port
changeset 370 2ee4da8122f4
parent 369 70bc85b31c6d
child 371 3da43513e638
reply and retweet links now work.
src/js/widgets/tweetsWidget.js
src/templates/tweetWidget.html
--- a/src/js/widgets/tweetsWidget.js	Thu Dec 01 11:40:35 2011 +0100
+++ b/src/js/widgets/tweetsWidget.js	Thu Dec 01 11:40:53 2011 +0100
@@ -36,6 +36,13 @@
                                 "<div class='Ldt-tweet_tweetContents'>{{{ contents }}}</div>" +
                                 "<div class='Ldt-tweet_date'>{{ date }}</div>", 
                                 {creator: creator, real_name: real_name, contents : title, date : formatted_date});
+
+      this.selector.find(".Ldt-TweetReply").attr("href", "http://twitter.com/home?status=@" + creator + ":%20");
+
+
+      var rtText = Mustache.to_html("http://twitter.com/home?status=RT @{{creator}}: {{text}}",
+                                    {creator: creator, text: IriSP.encodeURI(annotation.content.title)});
+      this.selector.find(".Ldt-Retweet").attr("href", rtText);
     }
 
     this.selector.find(".Ldt-tweetContents").html(title);
--- a/src/templates/tweetWidget.html	Thu Dec 01 11:40:35 2011 +0100
+++ b/src/templates/tweetWidget.html	Thu Dec 01 11:40:53 2011 +0100
@@ -5,6 +5,6 @@
   <img src='{{img_dir}}/profile_arrow.png' class='Ldt-tweetAvatar-profileArrow'></img>
   <div class='Ldt-tweetContents'>
   </div>
-  <div class='Ldt-Retweet'><div class='Ldt-RetweetIcon'></div> - Retweet </div>
-  <div class='Ldt-TweetReply'><div class='Ldt-TweetReplyIcon'></div> - Reply</div>
+  <a href='' target='_blank' class='Ldt-Retweet'><div class='Ldt-RetweetIcon'></div> - Retweet </a>
+  <a href='' target='_blank' class='Ldt-TweetReply'><div class='Ldt-TweetReplyIcon'></div> - Reply</a>
 </div>