]> git.mxchange.org Git - friendica.git/blobdiff - js/main.js
Merge pull request #803 from annando/master
[friendica.git] / js / main.js
index 488d5d4c72d63d950ac9afab4a7a092fca0a2fc7..a4a1c977cab9c799974ab26dfcffa56df0584617 100644 (file)
 
                                $("img[data-src]", nnm).each(function(i, el){
                                        // Add src attribute for images with a data-src attribute
-                                       $(el).attr('src', $(el).data("src"));
+                                       // However, don't bother if the data-src attribute is empty, because
+                                       // an empty "src" tag for an image will cause some browsers
+                                       // to prefetch the root page of the Friendica hub, which will
+                                       // unnecessarily load an entire profile/ or network/ page
+                                       if($(el).data("src") != '') $(el).attr('src', $(el).data("src"));
                                });
                        }
 
                        }
                        /* autocomplete @nicknames */
                        $(".comment-edit-form  textarea").contact_autocomplete(baseurl+"/acl");
+
+                       // setup videos, since VideoJS won't take care of any loaded via AJAX
+                       if(typeof videojs != 'undefined') videojs.autoSetup();
                });
        }