]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Created addPop() for Realtime plugin and added param to include iconurl
authorSarven Capadisli <csarven@status.net>
Wed, 23 Sep 2009 21:58:35 +0000 (21:58 +0000)
committerSarven Capadisli <csarven@status.net>
Wed, 23 Sep 2009 21:58:35 +0000 (21:58 +0000)
plugins/Realtime/RealtimePlugin.php
plugins/Realtime/realtimeupdate.js

index fde30602166e7b859c85abd4a459a9f7354e7a14..157c800d95d05e856c8b47475c35f103f810efff 100644 (file)
@@ -99,11 +99,13 @@ class RealtimePlugin extends Plugin
             $user_id = 0;
         }
 
+        $iconurl = $base.'plugins/Realtime/icon_external.gif';
+
         $action->elementStart('script', array('type' => 'text/javascript'));
 
         $script = ' $(document).ready(function() { '.
           $this->_updateInitialize($timeline, $user_id).
-          ' RealtimeUpdate.addPopup("'.$url.'", "'.$title.'"); '.
+          ' RealtimeUpdate.addPopup("'.$url.'", "'.$title.'", "'. $iconurl .'");'
           '}); ';
 
         $action->raw($script);
index 04e07956d5def8a98996f6f016edab7f3f2f818d..2910e4a802162a3f358403b86613e0b1815022a8 100644 (file)
@@ -111,9 +111,30 @@ RealtimeUpdate = {
           return dl;
      },
 
-     addPopup: function(url, title)
+     addPopup: function(url, title, iconurl)
      {
-          // FIXME: need to add the realtime popup button here
+         $('#site_nav_local_views .current a').append('<button id="realtime_timeline" title="Real-time pop window">&#8599;</button>');
+         $('#realtime_timeline').css({
+             'margin':'2px 0 0 11px',
+             'background':'transparent url('+ iconurl + ') no-repeat 45% 45%',
+             'text-indent':'-9999px',
+             'width':'16px',
+             'height':'16px',
+             'padding':'0',
+             'display':'block',
+             'float':'right',
+             'border':'none',
+             'cursor':'pointer'
+         });
+         $('#realtime_timeline').click(function() {
+             window.open(url,
+                         title,
+                         'toolbar=no,resizable=yes,scrollbars=yes,status=yes');
+             return false;
+         });
      }
 }