From: Evan Prodromou Date: Sun, 26 Apr 2009 19:37:00 +0000 (-0400) Subject: Make notice auto-update X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=7dbb5fb8fdf7c4f82c212863a17793a50f887f58;p=quix0rs-gnu-social.git Make notice auto-update Shows notices auto-updating --- diff --git a/plugins/Comet/CometPlugin.php b/plugins/Comet/CometPlugin.php index f60d400751..a7a4f4b237 100644 --- a/plugins/Comet/CometPlugin.php +++ b/plugins/Comet/CometPlugin.php @@ -126,6 +126,11 @@ class CometPlugin extends Plugin $act = new TwitterApiAction('/dev/null'); $arr = $act->twitter_status_array($notice, true); + $arr['url'] = $notice->bestUrl(); + + $profile = $notice->getProfile(); + $arr['user']['profile_url'] = $profile->profileurl; + return $arr; } diff --git a/plugins/Comet/updatetimeline.js b/plugins/Comet/updatetimeline.js index 7b22445e30..c6eefb4475 100644 --- a/plugins/Comet/updatetimeline.js +++ b/plugins/Comet/updatetimeline.js @@ -23,14 +23,45 @@ var updater = function() function receive(message) { - alert("Received notice."); var noticeItem = makeNoticeItem(message.data); - var noticeList = $('ul.notices'); + $("#notices_primary .notices").prepend(noticeItem, true); + $("#notices_primary .notice:first").css({display:"none"}); + $("#notices_primary .notice:first").fadeIn(2500); + NoticeHover(); + NoticeReply(); } function makeNoticeItem(data) { - return ''; + user = data['user']; + ni = "
  • "+ + "
    "+ + ""+ + ""+ + "\""+user['screen_name']+"\"/"+ + ""+user['screen_name']+""+ + ""+ + ""+ + "

    "+data['text']+"

    "+ + "
    "+ + "
    "+ + "
    "+ + "
    Published
    "+ + "
    "+ + ""+ + "a few seconds ago"+ + " "+ + "
    "+ + "
    "+ + "
    "+ + "
    From
    "+ + "
    "+data['source']+"
    "+ + "
    "+ + "
    "+ + "
    "+ + "
    "+ + "
  • "; + return ni; } }();