From a428695f8e9e3441bd3012a74a8385a713034007 Mon Sep 17 00:00:00 2001 From: Mike Macgirvin Date: Mon, 20 Sep 2010 22:27:33 -0700 Subject: [PATCH] pass vars via javascript, not html. Also fix broken pause img on IE --- include/main.js | 16 ++++++---------- index.php | 2 +- mod/network.php | 7 +++++-- mod/profile.php | 7 +++++-- 4 files changed, 17 insertions(+), 15 deletions(-) diff --git a/include/main.js b/include/main.js index 1ddab0dc2c..8245cef2fe 100644 --- a/include/main.js +++ b/include/main.js @@ -49,15 +49,11 @@ event.preventDefault(); if(stopped == false) { stopped = true; - $('#pause img').attr('src','images/pause.gif'); - $('#pause img').css({'border': '1px solid black'}); - + $('#pause').html('pause'); } else { stopped = false; - $('#pause img').attr('src',''); - $('#pause img').css({'border': 'none'}); - + $('#pause').html(''); } } }); @@ -65,8 +61,8 @@ function NavUpdate() { - if($('#live-network').length) { src = 'network'; pr = $('#live-network').attr('profile'); liveUpdate(); } - if($('#live-profile').length) { src = 'profile'; pr = $('#live-profile').attr('profile'); liveUpdate(); } + if($('#live-network').length) { src = 'network'; liveUpdate(); } + if($('#live-profile').length) { src = 'profile'; liveUpdate(); } if(! stopped) { $.get("ping",function(data) { @@ -91,14 +87,14 @@ } function liveUpdate() { - if((src == null) || (stopped)) { $('.like-rotator').hide(); return; } + if((src == null) || (stopped) || (! profile_uid)) { $('.like-rotator').hide(); return; } if($('.comment-edit-text-full').length) { livetime = setTimeout(liveUpdate, 10000); return; } prev = 'live-' + src; - $.get('update_' + src + '?p=' + pr + '&msie=' + ((msie) ? 1 : 0),function(data) { + $.get('update_' + src + '?p=' + profile_uid + '&msie=' + ((msie) ? 1 : 0),function(data) { $('.wall-item-outside-wrapper',data).each(function() { var ident = $(this).attr('id'); if($('#' + ident).length == 0) { diff --git a/index.php b/index.php index 0de0afd48d..c4de99fb67 100644 --- a/index.php +++ b/index.php @@ -86,7 +86,7 @@ if(x($_SESSION,'sysmsg')) { // Feel free to comment out this line on production sites. $a->page['content'] .= $debug_text; -$a->page['content'] .= '
'; +$a->page['content'] .= '
'; // build page diff --git a/mod/network.php b/mod/network.php index e9e730340b..ac6286e6d1 100644 --- a/mod/network.php +++ b/mod/network.php @@ -58,8 +58,11 @@ function network_content(&$a, $update = 0) { // filtering by group and also you aren't writing a comment (the last // criteria is discovered in javascript). - if($a->pager['start'] == 0 && $a->argc == 1) - $o .= '
' . "\r\n"; + if($a->pager['start'] == 0 && $a->argc == 1) { + $o .= '
' . "\r\n"; + $o .= "\r\n"; + } + } // We aren't going to try and figure out at the item, group, and page level diff --git a/mod/profile.php b/mod/profile.php index 4adcd29f6b..b155acf80f 100644 --- a/mod/profile.php +++ b/mod/profile.php @@ -163,8 +163,11 @@ function profile_content(&$a, $update = 0) { // This is ugly, but we can't pass the profile_uid through the session to the ajax updater, // because browser prefetching might change it on us. We have to deliver it with the page. - if($tab == 'posts' && (! $a->pager['start'])) - $o .= '
' . "\r\n"; + if($tab == 'posts' && (! $a->pager['start'])) { + $o .= '
' . "\r\n"; + $o .= "\r\n"; + } + } // TODO alter registration and settings and profile to update contact table when names and photos change.