diff options
author | Evan Prodromou <evan@status.net> | 2009-09-23 15:24:12 -0400 |
---|---|---|
committer | Evan Prodromou <evan@status.net> | 2009-09-23 15:24:12 -0400 |
commit | bdbc2cb8de370eef6d5d06412746f52797ea0458 (patch) | |
tree | c4ed8a464284305a12369c68c0aa491e2ed4c6bb /plugins | |
parent | 36e009349d68d8f34fc50d77c26e6e3307116b2c (diff) |
move some stuff around for realtime
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/Realtime/RealtimePlugin.php | 32 | ||||
-rw-r--r-- | plugins/Realtime/realtimeupdate.js | 5 |
2 files changed, 15 insertions, 22 deletions
diff --git a/plugins/Realtime/RealtimePlugin.php b/plugins/Realtime/RealtimePlugin.php index c41c9ce4a..fde306021 100644 --- a/plugins/Realtime/RealtimePlugin.php +++ b/plugins/Realtime/RealtimePlugin.php @@ -76,6 +76,15 @@ class RealtimePlugin extends Plugin return true; } + $base = $action->selfUrl(); + if (mb_strstr($url, '?')) { + $url = $base . '&realtime=1'; + } else { + $url = $base . '?realtime=1'; + } + + $title = $action->title(); + $scripts = $this->_getScripts(); foreach ($scripts as $script) { @@ -94,6 +103,7 @@ class RealtimePlugin extends Plugin $script = ' $(document).ready(function() { '. $this->_updateInitialize($timeline, $user_id). + ' RealtimeUpdate.addPopup("'.$url.'", "'.$title.'"); '. '}); '; $action->raw($script); @@ -189,28 +199,6 @@ class RealtimePlugin extends Plugin return true; } - function onStartShowPageNotice($action) - { - $timeline = $this->_getTimeline($action); - if (!empty($timeline)) { - $base = $action->selfUrl(); - if (mb_strstr($url, '?')) { - $url = $base . '&realtime=1'; - } else { - $url = $base . '?realtime=1'; - } - $title = $action->title(); - $code = "window.open('$url', '$title', 'toolbar=no,resizable=yes,scrollbars=yes,status=yes,height=640,width=575');"; - $action->element('a', array('href' => $base, - 'onclick' => $code, - 'id' => 'realtime_timeline', - 'title' => _('Pop up')), - 'Pop up'); - - } - return true; - } - function onStartShowBody($action) { $realtime = $action->boolean('realtime'); diff --git a/plugins/Realtime/realtimeupdate.js b/plugins/Realtime/realtimeupdate.js index 3293ef6e9..04e07956d 100644 --- a/plugins/Realtime/realtimeupdate.js +++ b/plugins/Realtime/realtimeupdate.js @@ -109,6 +109,11 @@ RealtimeUpdate = { dl = "<a class=\"notice_delete\" href=\""+delurl+"\" title=\"Delete this notice\">Delete</a>"; return dl; + }, + + addPopup: function(url, title) + { + // FIXME: need to add the realtime popup button here } } |