]> git.mxchange.org Git - friendica.git/blobdiff - js/main.js
more work on enotify
[friendica.git] / js / main.js
index 829af2258f03bae1591be2f09f431e48f9664534..96c7fa642b3d29779d7e7036ae2a6896bd80ac06 100644 (file)
                                });
                        }) ;
                }
-               timer = setTimeout(NavUpdate,30000);
+               timer = setTimeout(NavUpdate,updateInterval);
        }
 
        function liveUpdate() {
                if((src == null) || (stopped) || (! profile_uid)) { $('.like-rotator').hide(); return; }
                if(($('.comment-edit-text-full').length) || (in_progress)) {
+                       if(livetime) {
+                               clearTimeout(livetime);
+                       }
                        livetime = setTimeout(liveUpdate, 10000);
                        return;
                }
+               if(livetime != null)
+                       livetime = null;
+
                prev = 'live-' + src;
 
                in_progress = true;
 
                        $('.tread-wrapper',data).each(function() {
                                var ident = $(this).attr('id');
-                               if($('#' + ident).length == 0) {
+
+                               if($('#' + ident).length == 0 && profile_page == 1) {
                                        $('img',this).each(function() {
                                                $(this).attr('src',$(this).attr('dst'));
                                        });
                                        $('#' + prev).after($(this));
                                }
+                               else {
+                                       $('img',this).each(function() {
+                                               $(this).attr('src',$(this).attr('dst'));
+                                       });
+                                       $('#' + ident).replaceWith($(this));
+                               }
                                prev = ident;
                        });
 
                        // reset vars for inserting individual items
 
-                       prev = 'live-' + src;
+                       /*                      prev = 'live-' + src;
 
                        $('.wall-item-outside-wrapper',data).each(function() {
                                var ident = $(this).attr('id');
-                               if($('#' + ident).length == 0) {
-                                       $('img',this).each(function() {
-                                               $(this).attr('src',$(this).attr('dst'));
-                                       });
-                                       $('#' + prev).after($(this));
+
+                               if($('#' + ident).length == 0 && prev != 'live-' + src) {
+                                               $('img',this).each(function() {
+                                                       $(this).attr('src',$(this).attr('dst'));
+                                               });
+                                               $('#' + prev).after($(this));
                                }
                                else { 
                                        $('#' + ident + ' ' + '.wall-item-ago').replaceWith($(this).find('.wall-item-ago')); 
                                }
                                prev = ident; 
                        });
-
+                       */
                        $('.like-rotator').hide();
                        if(commentBusy) {
                                commentBusy = false;