diff options
author | Sarven Capadisli <csarven@status.net> | 2009-11-16 22:00:15 +0000 |
---|---|---|
committer | Sarven Capadisli <csarven@status.net> | 2009-11-16 22:00:15 +0000 |
commit | 629532e2da239b791b245ce702170d0b8de9c0ef (patch) | |
tree | 683272932d6cb52b78b37227f908f3e41112c8df /plugins/Realtime | |
parent | e4d191334f5b2e40a4cd97e1c23677d4712b7700 (diff) |
Added update delay and max notice count
Diffstat (limited to 'plugins/Realtime')
-rw-r--r-- | plugins/Realtime/realtimeupdate.js | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/plugins/Realtime/realtimeupdate.js b/plugins/Realtime/realtimeupdate.js index e82b4dbfb..59045c094 100644 --- a/plugins/Realtime/realtimeupdate.js +++ b/plugins/Realtime/realtimeupdate.js @@ -34,6 +34,8 @@ RealtimeUpdate = { _favorurl: '', _deleteurl: '', _updatecounter: 0, + _updatedelay: 500, + _maxnotices: 50, init: function(userid, replyurl, favorurl, deleteurl) { @@ -76,11 +78,16 @@ RealtimeUpdate = { $("#notices_primary .notices").prepend(noticeItem); $("#notices_primary .notice:first").css({display:"none"}); $("#notices_primary .notice:first").fadeIn(1000); + + if ($('#notices_primary .notice').length > RealtimeUpdate._maxnotices) { + $("#notices_primary .notice:last").remove(); + } + NoticeReply(); RealtimeUpdate._updatecounter += 1; document.title = '('+RealtimeUpdate._updatecounter+') ' + DT; - }, 500); + }, RealtimeUpdate._updatedelay); }, makeNoticeItem: function(data) |