]> git.mxchange.org Git - friendica.git/commitdiff
live update
authorMike Macgirvin <mike@macgirvin.com>
Sat, 24 Jul 2010 13:56:02 +0000 (06:56 -0700)
committerMike Macgirvin <mike@macgirvin.com>
Sat, 24 Jul 2010 13:56:02 +0000 (06:56 -0700)
mod/network.php
mod/profile.php
view/jot-header.tpl

index 0e8c8746f38a1b063afd30c2df64790cc240f43a..38d2bbb0cb60c2c3cf35eb2b73c7809b40ee8d4b 100644 (file)
@@ -39,6 +39,9 @@ function network_content(&$a) {
        ));
 
 
+       $o .= '<div id="live-network"></div>' . "\r\n";
+
+
        $sql_extra = ''; 
 
 
index 6b425bcd1e8d70028ea66c0fb0bab555d0ca9fc6..a317568c135b306e334ebcd936ff7f073b792d5d 100644 (file)
@@ -117,6 +117,9 @@ function profile_content(&$a) {
                ));
        }
 
+       if($tab == 'posts' && (! $a->pager['start']))
+               $o .= '<div id="live-profile"></div>' . "\r\n";
+
 
        // TODO alter registration and settings and profile to update contact table when names and  photos change.  
 
index 760cf588203b6b8ee06bf86102f70f2f3d045a39..8505b53bc247a56a0fb03f35f362f868e572075b 100644 (file)
@@ -50,6 +50,43 @@ tinyMCE.init({
                }
        }
 
+       var src = null;
+
+       $(document).ready(function() {
+               if($('#live-network').length) { src = 'net';  setTimeout(liveUpdate, 30000); }
+               if($('#live-profile').length) { src = 'wall'; setTimeout(liveUpdate, 30000); }
+       });
+
+       function liveUpdate() {
+               if(src == null) { return; }
+               if($('.comment-edit-text-full').length) {
+                       setTimeout(liveUpdate, 30000);
+                       return;
+               }
+
+//             $.get("live_update",function(data)
+//                     {
+//                     $(data).find('result').each(function() {
+//                             var net = $(this).find('net').text();
+//                             if(net == 0) { net = ''; }
+//                             $('#net-update').html(net);
+//                             var home = $(this).find('home').text();
+//                             if(home == 0) { home = ''; }
+//                             $('#home-update').html(home);
+//                             var mail = $(this).find('mail').text();
+//                             if(mail == 0) { mail = ''; }
+//                             $('#mail-update').html(mail);
+//                             var intro = $(this).find('intro').text();
+//                             if(intro == 0) { intro = ''; }
+//                             $('#notify-update').html(intro);
+//                     });
+//             }) ;
+
+               setTimeout(liveUpdate,30000);
+       }
+                       
+
+
 
 </script>