src/js/widgets/tweetsWidget.js
branchtweet-widget
changeset 285 b7aa28af2c10
parent 282 1001234e5e6e
child 293 314e6a13f841
equal deleted inserted replaced
284:cbb17aa3361c 285:b7aa28af2c10
    11 IriSP.TweetsWidget.prototype = new IriSP.Widget();
    11 IriSP.TweetsWidget.prototype = new IriSP.Widget();
    12 
    12 
    13 
    13 
    14 IriSP.TweetsWidget.prototype.drawTweet = function(annotation) {
    14 IriSP.TweetsWidget.prototype.drawTweet = function(annotation) {
    15     
    15     
    16     var title = annotation.content.title;
    16     var title = IriSP.formatTweet(annotation.content.title);
    17     var img = annotation.content.img.src;
    17     var img = annotation.content.img.src;
    18     if (typeof(img) === "undefined" || img === "" || img === "None") {
    18     if (typeof(img) === "undefined" || img === "" || img === "None") {
    19       img = IriSP.widgetsDefaults.TweetsWidget.default_profile_picture;
    19       img = IriSP.widgetsDefaults.TweetsWidget.default_profile_picture;
    20     }
    20     }
    21     
    21     
    22     var imageMarkup = Mustache.to_html("<img src='{{src}}' alt='avatar'></img>", 
    22     var imageMarkup = Mustache.to_html("<img src='{{src}}' alt='avatar'></img>", 
    23                                        {src : img});
    23                                        {src : img});
    24 
    24 
    25     this.selector.find(".Ldt-tweetContents").text(title);
    25     this.selector.find(".Ldt-tweetContents").html(title);
    26     this.selector.find(".Ldt-tweetAvatar").html(imageMarkup);
    26     this.selector.find(".Ldt-tweetAvatar").html(imageMarkup);
    27     this.selector.show("blind", 250); 
    27     this.selector.show("blind", 250); 
    28 };
    28 };
    29 
    29 
    30 IriSP.TweetsWidget.prototype.displayTweet = function(annotation) {
    30 IriSP.TweetsWidget.prototype.displayTweet = function(annotation) {