aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Macgirvin <mike@macgirvin.com>2010-07-24 06:56:02 -0700
committerMike Macgirvin <mike@macgirvin.com>2010-07-24 06:56:02 -0700
commita93f5627c1cb05f2f2c14cc390d38799eaf461e8 (patch)
tree2511f2145617c5f30499906833dc4d70aafb91ab
parent1db8ab907bb191b215f74be456861f1ca59ded48 (diff)
downloadvolse-hubzilla-a93f5627c1cb05f2f2c14cc390d38799eaf461e8.tar.gz
volse-hubzilla-a93f5627c1cb05f2f2c14cc390d38799eaf461e8.tar.bz2
volse-hubzilla-a93f5627c1cb05f2f2c14cc390d38799eaf461e8.zip
live update
-rw-r--r--mod/network.php3
-rw-r--r--mod/profile.php3
-rw-r--r--view/jot-header.tpl37
3 files changed, 43 insertions, 0 deletions
diff --git a/mod/network.php b/mod/network.php
index 0e8c8746f..38d2bbb0c 100644
--- a/mod/network.php
+++ b/mod/network.php
@@ -39,6 +39,9 @@ function network_content(&$a) {
));
+ $o .= '<div id="live-network"></div>' . "\r\n";
+
+
$sql_extra = '';
diff --git a/mod/profile.php b/mod/profile.php
index 6b425bcd1..a317568c1 100644
--- a/mod/profile.php
+++ b/mod/profile.php
@@ -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.
diff --git a/view/jot-header.tpl b/view/jot-header.tpl
index 760cf5882..8505b53bc 100644
--- a/view/jot-header.tpl
+++ b/view/jot-header.tpl
@@ -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>