diff --git a/plugins/Realtime/RealtimePlugin.php b/plugins/Realtime/RealtimePlugin.php index 0c7c1240c3..6d59bd1b12 100644 --- a/plugins/Realtime/RealtimePlugin.php +++ b/plugins/Realtime/RealtimePlugin.php @@ -101,8 +101,8 @@ class RealtimePlugin extends Plugin $realtimeUI = ' RealtimeUpdate.initPopupWindow();'; } else { - $iconurl = common_path('plugins/Realtime/icon_external.gif'); - $realtimeUI = ' RealtimeUpdate.addPopup("'.$url.'", "'.$timeline.'", "'. $iconurl .'");'; + $pluginPath = common_path('plugins/Realtime/'); + $realtimeUI = ' RealtimeUpdate.initActions("'.$url.'", "'.$timeline.'", "'. $pluginPath .'");'; } $action->elementStart('script', array('type' => 'text/javascript')); diff --git a/plugins/Realtime/icon_pause.gif b/plugins/Realtime/icon_pause.gif new file mode 100644 index 0000000000..ced0b6440c Binary files /dev/null and b/plugins/Realtime/icon_pause.gif differ diff --git a/plugins/Realtime/icon_play.gif b/plugins/Realtime/icon_play.gif new file mode 100644 index 0000000000..794ec85b6a Binary files /dev/null and b/plugins/Realtime/icon_play.gif differ diff --git a/plugins/Realtime/realtimeupdate.js b/plugins/Realtime/realtimeupdate.js index 6404cf8965..4352b45d99 100644 --- a/plugins/Realtime/realtimeupdate.js +++ b/plugins/Realtime/realtimeupdate.js @@ -37,6 +37,8 @@ RealtimeUpdate = { _maxnotices: 50, _windowhasfocus: true, _documenttitle: '', + _paused:false, + _queuedNotices:[], init: function(userid, replyurl, favorurl, deleteurl) { @@ -71,12 +73,16 @@ RealtimeUpdate = { return; } - RealtimeUpdate.purgeLastNoticeItem(); + if (RealtimeUpdate._paused === false) { + RealtimeUpdate.purgeLastNoticeItem(); - RealtimeUpdate.insertNoticeItem(data); - - RealtimeUpdate.updateWindowCounter(); + RealtimeUpdate.insertNoticeItem(data); + RealtimeUpdate.updateWindowCounter(); + } + else { + RealtimeUpdate._queuedNotices.push(data); + } }, insertNoticeItem: function(data) { @@ -183,7 +189,80 @@ RealtimeUpdate = { return dl; }, - addPopup: function(url, timeline, iconurl) + initActions: function(url, timeline, path) + { + var NP = $('#notices_primary'); + NP.prepend('