From 5c5a905eb94832f2f33dc6a0a99c77912a7ec09d Mon Sep 17 00:00:00 2001 From: Sarven Capadisli Date: Sun, 8 Nov 2009 22:55:53 +0000 Subject: Moved back to using lib twitterapi instead of api for 0.8.x --- plugins/Realtime/RealtimePlugin.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'plugins/Realtime') diff --git a/plugins/Realtime/RealtimePlugin.php b/plugins/Realtime/RealtimePlugin.php index 0c7c1240c..181927968 100644 --- a/plugins/Realtime/RealtimePlugin.php +++ b/plugins/Realtime/RealtimePlugin.php @@ -240,13 +240,13 @@ class RealtimePlugin extends Plugin // FIXME: this code should be abstracted to a neutral third // party, like Notice::asJson(). I'm not sure of the ethics // of refactoring from within a plugin, so I'm just abusing - // the ApiAction method. Don't do this unless you're me! + // the TwitterApiAction method. Don't do this unless you're me! - require_once(INSTALLDIR.'/lib/api.php'); + require_once(INSTALLDIR.'/lib/twitterapi.php'); - $act = new ApiAction('/dev/null'); + $act = new TwitterApiAction('/dev/null'); - $arr = $act->twitterStatusArray($notice, true); + $arr = $act->twitter_status_array($notice, true); $arr['url'] = $notice->bestUrl(); $arr['html'] = htmlspecialchars($notice->rendered); $arr['source'] = htmlspecialchars($arr['source']); -- cgit v1.2.3-54-g00ecf From 3752c1fdcee53c7e609d77600591b7de78b7ce3b Mon Sep 17 00:00:00 2001 From: Sarven Capadisli Date: Thu, 12 Nov 2009 10:37:43 +0000 Subject: Removed extra showScript() call at the bottom of the document. 0.8.x is using for scripts whereas 0.9.x puts it before . This also fixes the duplicate posts --- plugins/Realtime/RealtimePlugin.php | 1 - 1 file changed, 1 deletion(-) (limited to 'plugins/Realtime') diff --git a/plugins/Realtime/RealtimePlugin.php b/plugins/Realtime/RealtimePlugin.php index 181927968..0f0d0f9f4 100644 --- a/plugins/Realtime/RealtimePlugin.php +++ b/plugins/Realtime/RealtimePlugin.php @@ -230,7 +230,6 @@ class RealtimePlugin extends Plugin } $action->showContentBlock(); - $action->showScripts(); $action->elementEnd('body'); return false; // No default processing } -- cgit v1.2.3-54-g00ecf From e4d191334f5b2e40a4cd97e1c23677d4712b7700 Mon Sep 17 00:00:00 2001 From: Craig Andrews Date: Mon, 16 Nov 2009 16:19:27 -0500 Subject: Only show local notices or (remote notices if they're supposed to be shown) --- plugins/Realtime/RealtimePlugin.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'plugins/Realtime') diff --git a/plugins/Realtime/RealtimePlugin.php b/plugins/Realtime/RealtimePlugin.php index 0f0d0f9f4..a21c33b10 100644 --- a/plugins/Realtime/RealtimePlugin.php +++ b/plugins/Realtime/RealtimePlugin.php @@ -132,8 +132,8 @@ class RealtimePlugin extends Plugin // Add to the public timeline - if ($notice->is_local || - ($notice->is_local == 0 && !common_config('public', 'localonly'))) { + if ($notice->is_local == Notice::LOCAL_PUBLIC || + ($notice->is_local == Notice::REMOTE_OMB && !common_config('public', 'localonly'))) { $paths[] = array('public'); } -- cgit v1.2.3-54-g00ecf From 629532e2da239b791b245ce702170d0b8de9c0ef Mon Sep 17 00:00:00 2001 From: Sarven Capadisli Date: Mon, 16 Nov 2009 22:00:15 +0000 Subject: Added update delay and max notice count --- plugins/Realtime/realtimeupdate.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'plugins/Realtime') 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) -- cgit v1.2.3-54-g00ecf From be73757131127c687090f925ff873ff385a88604 Mon Sep 17 00:00:00 2001 From: Sarven Capadisli Date: Mon, 16 Nov 2009 22:16:08 +0000 Subject: Unbinding the events from Notice reply and favor for possible memory leaks --- plugins/Realtime/realtimeupdate.js | 3 +++ 1 file changed, 3 insertions(+) (limited to 'plugins/Realtime') diff --git a/plugins/Realtime/realtimeupdate.js b/plugins/Realtime/realtimeupdate.js index 59045c094..16c96615e 100644 --- a/plugins/Realtime/realtimeupdate.js +++ b/plugins/Realtime/realtimeupdate.js @@ -80,6 +80,9 @@ RealtimeUpdate = { $("#notices_primary .notice:first").fadeIn(1000); if ($('#notices_primary .notice').length > RealtimeUpdate._maxnotices) { + $("#notices_primary .notice:last .form_disfavor").unbind('submit'); + $("#notices_primary .notice:last .form_favor").unbind('submit'); + $("#notices_primary .notice:last #notice_in-reply-to").unbind('click'); $("#notices_primary .notice:last").remove(); } -- cgit v1.2.3-54-g00ecf From 8b4fd414218d162970cf997d260e070d0a5177fe Mon Sep 17 00:00:00 2001 From: Sarven Capadisli Date: Mon, 16 Nov 2009 22:16:55 +0000 Subject: Added NoticeFavors() for received notices --- plugins/Realtime/realtimeupdate.js | 1 + 1 file changed, 1 insertion(+) (limited to 'plugins/Realtime') diff --git a/plugins/Realtime/realtimeupdate.js b/plugins/Realtime/realtimeupdate.js index 16c96615e..2ded33e93 100644 --- a/plugins/Realtime/realtimeupdate.js +++ b/plugins/Realtime/realtimeupdate.js @@ -86,6 +86,7 @@ RealtimeUpdate = { $("#notices_primary .notice:last").remove(); } + NoticeFavors(); NoticeReply(); RealtimeUpdate._updatecounter += 1; -- cgit v1.2.3-54-g00ecf From ca31504dd91560496c55bf9a781e2d72e3fb367a Mon Sep 17 00:00:00 2001 From: Sarven Capadisli Date: Tue, 17 Nov 2009 00:07:21 +0000 Subject: Using the right selector for notice_reply --- plugins/Realtime/realtimeupdate.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plugins/Realtime') diff --git a/plugins/Realtime/realtimeupdate.js b/plugins/Realtime/realtimeupdate.js index 2ded33e93..132f79abb 100644 --- a/plugins/Realtime/realtimeupdate.js +++ b/plugins/Realtime/realtimeupdate.js @@ -82,7 +82,7 @@ RealtimeUpdate = { if ($('#notices_primary .notice').length > RealtimeUpdate._maxnotices) { $("#notices_primary .notice:last .form_disfavor").unbind('submit'); $("#notices_primary .notice:last .form_favor").unbind('submit'); - $("#notices_primary .notice:last #notice_in-reply-to").unbind('click'); + $("#notices_primary .notice:last .notice_reply").unbind('click'); $("#notices_primary .notice:last").remove(); } -- cgit v1.2.3-54-g00ecf From a6399ce73a7459a8ee7bc18f6b8c449e0b45b5fb Mon Sep 17 00:00:00 2001 From: Sarven Capadisli Date: Tue, 17 Nov 2009 00:28:56 +0000 Subject: Showing counter for new notices only if the window is on blur --- plugins/Realtime/realtimeupdate.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'plugins/Realtime') diff --git a/plugins/Realtime/realtimeupdate.js b/plugins/Realtime/realtimeupdate.js index 132f79abb..fa0fefed4 100644 --- a/plugins/Realtime/realtimeupdate.js +++ b/plugins/Realtime/realtimeupdate.js @@ -36,6 +36,7 @@ RealtimeUpdate = { _updatecounter: 0, _updatedelay: 500, _maxnotices: 50, + _windowhasfocus: false, init: function(userid, replyurl, favorurl, deleteurl) { @@ -46,7 +47,9 @@ RealtimeUpdate = { DT = document.title; - $(window).blur(function() { + $(window).bind('focus', function(){ RealtimeUpdate._windowhasfocus = true; }); + + $(window).bind('blur', function() { $('#notices_primary .notice').css({ 'border-top-color':$('#notices_primary .notice:last').css('border-top-color'), 'border-top-style':'dotted' @@ -59,6 +62,7 @@ RealtimeUpdate = { RealtimeUpdate._updatecounter = 0; document.title = DT; + RealtimeUpdate._windowhasfocus = false; return false; }); @@ -89,8 +93,10 @@ RealtimeUpdate = { NoticeFavors(); NoticeReply(); - RealtimeUpdate._updatecounter += 1; - document.title = '('+RealtimeUpdate._updatecounter+') ' + DT; + if (RealtimeUpdate._windowhasfocus === false) { + RealtimeUpdate._updatecounter += 1; + document.title = '('+RealtimeUpdate._updatecounter+') ' + DT; + } }, RealtimeUpdate._updatedelay); }, -- cgit v1.2.3-54-g00ecf From b51df36189e631d9440bd9182bc4bb01624751b6 Mon Sep 17 00:00:00 2001 From: Sarven Capadisli Date: Fri, 20 Nov 2009 04:09:40 +0000 Subject: Reduced entity_profile width in pop up --- plugins/Realtime/realtimeupdate.js | 2 ++ 1 file changed, 2 insertions(+) (limited to 'plugins/Realtime') diff --git a/plugins/Realtime/realtimeupdate.js b/plugins/Realtime/realtimeupdate.js index a2c4da113..f383dc3fb 100644 --- a/plugins/Realtime/realtimeupdate.js +++ b/plugins/Realtime/realtimeupdate.js @@ -301,6 +301,8 @@ RealtimeUpdate = { return false; }); + + $('#showstream .entity_profile').css({'width':'69%'}); } } -- cgit v1.2.3-54-g00ecf From c6e4feb815a60a7baf613026c414a24c5c918650 Mon Sep 17 00:00:00 2001 From: Sarven Capadisli Date: Fri, 20 Nov 2009 05:28:10 +0000 Subject: These changes didn't go into master (from 0.9-release) --- plugins/Realtime/RealtimePlugin.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'plugins/Realtime') diff --git a/plugins/Realtime/RealtimePlugin.php b/plugins/Realtime/RealtimePlugin.php index 198cb5ad7..c5fb6de03 100644 --- a/plugins/Realtime/RealtimePlugin.php +++ b/plugins/Realtime/RealtimePlugin.php @@ -139,8 +139,8 @@ class RealtimePlugin extends Plugin // Add to the public timeline - if ($notice->is_local == Notice::LOCAL_PUBLIC || - ($notice->is_local == Notice::REMOTE_OMB && !common_config('public', 'localonly'))) { + if ($notice->is_local || + ($notice->is_local == 0 && !common_config('public', 'localonly'))) { $paths[] = array('public'); } @@ -237,6 +237,7 @@ class RealtimePlugin extends Plugin } $action->showContentBlock(); + $action->showScripts(); $action->elementEnd('body'); return false; // No default processing } @@ -246,13 +247,13 @@ class RealtimePlugin extends Plugin // FIXME: this code should be abstracted to a neutral third // party, like Notice::asJson(). I'm not sure of the ethics // of refactoring from within a plugin, so I'm just abusing - // the TwitterApiAction method. Don't do this unless you're me! + // the ApiAction method. Don't do this unless you're me! - require_once(INSTALLDIR.'/lib/twitterapi.php'); + require_once(INSTALLDIR.'/lib/api.php'); - $act = new TwitterApiAction('/dev/null'); + $act = new ApiAction('/dev/null'); - $arr = $act->twitter_status_array($notice, true); + $arr = $act->twitterStatusArray($notice, true); $arr['url'] = $notice->bestUrl(); $arr['html'] = htmlspecialchars($notice->rendered); $arr['source'] = htmlspecialchars($arr['source']); -- cgit v1.2.3-54-g00ecf From 3db551ed5a3778c9a80f8ba42166d77426724648 Mon Sep 17 00:00:00 2001 From: Craig Andrews Date: Fri, 20 Nov 2009 15:34:48 -0500 Subject: Undo part of c6e4feb815a60a7baf613026c414a24c5c918650 so that blacklisted notices are not displayed in realtime --- plugins/Realtime/RealtimePlugin.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'plugins/Realtime') diff --git a/plugins/Realtime/RealtimePlugin.php b/plugins/Realtime/RealtimePlugin.php index c5fb6de03..b737e442a 100644 --- a/plugins/Realtime/RealtimePlugin.php +++ b/plugins/Realtime/RealtimePlugin.php @@ -139,8 +139,8 @@ class RealtimePlugin extends Plugin // Add to the public timeline - if ($notice->is_local || - ($notice->is_local == 0 && !common_config('public', 'localonly'))) { + if ($notice->is_local == Notice::LOCAL_PUBLIC || + ($notice->is_local == Notice::REMOTE_OMB && !common_config('public', 'localonly'))) { $paths[] = array('public'); } -- cgit v1.2.3-54-g00ecf