]> git.mxchange.org Git - friendica.git/commitdiff
pass vars via javascript, not html. Also fix broken pause img on IE
authorMike Macgirvin <mike@macgirvin.com>
Tue, 21 Sep 2010 05:27:33 +0000 (22:27 -0700)
committerMike Macgirvin <mike@macgirvin.com>
Tue, 21 Sep 2010 05:27:33 +0000 (22:27 -0700)
include/main.js
index.php
mod/network.php
mod/profile.php

index 1ddab0dc2c124a5a79f235fd1e887f35cdaeca44..8245cef2fee31afc236438624a385c3dce10b624 100644 (file)
                                event.preventDefault();
                                if(stopped == false) {
                                        stopped = true;
-                                       $('#pause img').attr('src','images/pause.gif');
-                                       $('#pause img').css({'border': '1px solid black'});
-
+                                       $('#pause').html('<img src="images/pause.gif" alt="pause" style="border: 1px solid black;" />');
                                }
                                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) {
        }
 
        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) { 
index 0de0afd48d01867e7c1649bccf9c06d73ac297e9..c4de99fb67454e6704e3e79ca390c834c7f91709 100644 (file)
--- 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'] .= '<div id="pause"><img src="" alt="" /></div>';
+$a->page['content'] .= '<div id="pause"></div>';
 // build page
 
 
index e9e730340b834f05cc366c5600f68e721d9fd936..ac6286e6d1a3be41d4e030660e5a96b00a44cafd 100644 (file)
@@ -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 .= '<div id="live-network" profile="' . $_SESSION['uid'] . '"></div>' . "\r\n";
+               if($a->pager['start'] == 0 && $a->argc == 1) {
+                       $o .= '<div id="live-network"></div>' . "\r\n";
+                       $o .= "<script> var profile_uid = " . $_SESSION['uid'] . "; </script>\r\n";
+               }
+
        }
 
        // We aren't going to try and figure out at the item, group, and page level 
index 4adcd29f6bdaaa6c476bda385cb773e3620d4bed..b155acf80f433fa8c4239a005255f258412cf01a 100644 (file)
@@ -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 .= '<div id="live-profile" profile="' . $a->profile['profile_uid'] . '"></div>' . "\r\n";
+               if($tab == 'posts' && (! $a->pager['start'])) {
+                       $o .= '<div id="live-profile"></div>' . "\r\n";
+                       $o .= "<script> var profile_uid = " . $a->profile['profile_uid'] . "; </script>\r\n";
+               }
+
        }
 
        // TODO alter registration and settings and profile to update contact table when names and  photos change.