X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=plugins%2FRealtime%2FRealtimePlugin.php;h=cbfa6bae0058d4595f1365be4f56739003f656d4;hb=f987273f118a12d443b6789c2ab59d7a4b01f678;hp=181927968648a132f2ef9754725502f3b8d4b5af;hpb=54e8f583ace8d22291f3bb42d2fb6556517d3ab6;p=quix0rs-gnu-social.git diff --git a/plugins/Realtime/RealtimePlugin.php b/plugins/Realtime/RealtimePlugin.php index 1819279686..cbfa6bae00 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')); @@ -118,7 +118,14 @@ class RealtimePlugin extends Plugin return true; } - function onEndNoticeSave($notice) + function onEndShowStatusNetStyles($action) + { + $action->cssLink(common_path('plugins/Realtime/realtimeupdate.css'), + null, 'screen, projection, tv'); + return true; + } + + function onHandleQueuedNotice($notice) { $paths = array(); @@ -132,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'); } @@ -213,8 +220,9 @@ class RealtimePlugin extends Plugin $action->elementStart('body', (common_current_user()) ? array('id' => $action->trimmed('action'), - 'class' => 'user_in') - : array('id' => $action->trimmed('action'))); + 'class' => 'user_in realtime-popup') + : array('id' => $action->trimmed('action'), + 'class'=> 'realtime-popup')); // XXX hack to deal with JS that tries to get the // root url from page output @@ -240,13 +248,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']);