]> git.mxchange.org Git - friendica.git/commitdiff
Merge pull request #569 from oohlaf/fixes
authorOlaf Conradi <oohlaf@gmail.com>
Sun, 30 Dec 2012 16:17:36 +0000 (08:17 -0800)
committerOlaf Conradi <oohlaf@gmail.com>
Sun, 30 Dec 2012 16:17:36 +0000 (08:17 -0800)
Fix browser prefetch of template strings in images

36 files changed:
js/acl.js
js/main.js
view/acl_selector.tpl
view/nav.tpl
view/smarty3/acl_selector.tpl
view/smarty3/nav.tpl
view/theme/cleanzero/nav.tpl
view/theme/cleanzero/smarty3/nav.tpl
view/theme/diabook/nav.tpl
view/theme/diabook/smarty3/nav.tpl
view/theme/dispy/nav.tpl
view/theme/dispy/smarty3/nav.tpl
view/theme/duepuntozero/nav.tpl
view/theme/duepuntozero/smarty3/nav.tpl
view/theme/facepark/nav.tpl
view/theme/facepark/smarty3/nav.tpl
view/theme/frost-mobile/acl_selector.tpl
view/theme/frost-mobile/js/acl.js
view/theme/frost-mobile/js/main.js
view/theme/frost-mobile/nav.tpl
view/theme/frost-mobile/smarty3/acl_selector.tpl
view/theme/frost-mobile/smarty3/nav.tpl
view/theme/frost/acl_selector.tpl
view/theme/frost/js/acl.js
view/theme/frost/js/main.js
view/theme/frost/nav.tpl
view/theme/frost/smarty3/acl_selector.tpl
view/theme/frost/smarty3/nav.tpl
view/theme/quattro/nav.tpl
view/theme/quattro/smarty3/nav.tpl
view/theme/smoothly/nav.tpl
view/theme/smoothly/smarty3/nav.tpl
view/theme/testbubble/nav.tpl
view/theme/testbubble/smarty3/nav.tpl
view/theme/vier/nav.tpl
view/theme/vier/smarty3/nav.tpl

index e383224ca8aba067bd952b59e0f04e089b67a314..36cf74970fbac1e83df66fa67da46f4d0711040c 100644 (file)
--- a/js/acl.js
+++ b/js/acl.js
@@ -248,11 +248,16 @@ ACL.prototype.populate = function(data){
        that.list_content.height(height);
        $(data.items).each(function(){
                html = "<div class='acl-list-item {4} {5}' title='{6}' id='{2}{3}'>"+that.item_tpl+"</div>";
-               html = html.format( this.photo, this.name, this.type, this.id, '', this.network, this.link );
+               html = html.format(this.photo, this.name, this.type, this.id, '', this.network, this.link);
                if (this.uids!=undefined) that.group_uids[this.id] = this.uids;
                //console.log(html);
                that.list_content.append(html);
        });
+       $(".acl-list-item img[data-src]").each(function(i, el){
+               // Replace data-src attribute with src attribute for every image
+               $(el).attr('src', $(el).data("src"));
+               $(el).removeAttr("data-src");
+       });
        that.update_view();
 }
 
index 4a75be747ad4da5011a3ef1f2e8c89b3da668312..5cdf2a08047d0a13bf7b290ef3f352b3b838b00e 100644 (file)
                                        html = notifications_tpl.format(e.attr('href'),e.attr('photo'), text, e.attr('date'), e.attr('seen'));
                                        nnm.append(html);
                                });
+
+                               $("img[data-src]", nnm).each(function(i, el){
+                                       // Replace data-src attribute with src attribute for every image
+                                       $(el).attr('src', $(el).data("src"));
+                                       $(el).removeAttr("data-src");
+                               });
                        }
+
                        notif = eNotif.attr('count');
                        if (notif>0){
                                $("#nav-notifications-linkmenu").addClass("on");
                        });
                        
                });
-               
-               
+
                NavUpdate(); 
                // Allow folks to stop the ajax page updates with the pause/break key
                $(document).keydown(function(event) {
index 655ea89807971c6f3f07aaa1663933ef3c92b549..837225a5b12fa9594732895d9d29d91cc3f9f4dd 100644 (file)
@@ -9,7 +9,7 @@
 </div>
 
 <div class="acl-list-item" rel="acl-template" style="display:none">
-       <img src="{0}"><p>{1}</p>
+       <img data-src="{0}"><p>{1}</p>
        <a href="#" class='acl-button-show'>$show</a>
        <a href="#" class='acl-button-hide'>$hide</a>
 </div>
index 8969accb73544bb8af0d38c18e40b045b22094d2..04c4931fc65eeca3263f329eb9b5e5d1c50c7fdc 100644 (file)
@@ -64,5 +64,5 @@
 </nav>
 
 <ul id="nav-notifications-template" style="display:none;" rel="template">
-       <li class="{4}"><a href="{0}"><img src="{1}" height="24" width="24" alt="" />{2} <span class="notif-when">{3}</span></a></li>
+       <li class="{4}"><a href="{0}"><img data-src="{1}" height="24" width="24" alt="" />{2} <span class="notif-when">{3}</span></a></li>
 </ul>
index 52f0573c8a387fcab3f1c99bfab26f428bf6de63..e9f8030d7ccb301652bf3be6899430d58504c333 100644 (file)
@@ -9,7 +9,7 @@
 </div>
 
 <div class="acl-list-item" rel="acl-template" style="display:none">
-       <img src="{0}"><p>{1}</p>
+       <img data-src="{0}"><p>{1}</p>
        <a href="#" class='acl-button-show'>{{$show}}</a>
        <a href="#" class='acl-button-hide'>{{$hide}}</a>
 </div>
index 832d9f123cd8eaeb2f8f95c50ff2d2d4fd61d395..7f7bb6290f5103b37f5d5ab2cbb7f1f17de31f10 100644 (file)
@@ -64,5 +64,5 @@
 </nav>
 
 <ul id="nav-notifications-template" style="display:none;" rel="template">
-       <li class="{4}"><a href="{0}"><img src="{1}" height="24" width="24" alt="" />{2} <span class="notif-when">{3}</span></a></li>
+       <li class="{4}"><a href="{0}"><img data-src="{1}" height="24" width="24" alt="" />{2} <span class="notif-when">{3}</span></a></li>
 </ul>
index 981f975c92220599daeccea83f0cbeef343dce95..17a2f725905fde6a9d10d6edbb98cb4c2b68eddf 100644 (file)
@@ -69,7 +69,7 @@
 </nav>
 
 <ul id="nav-notifications-template" style="display:none;" rel="template">
-       <li class="{4}"><a href="{0}"><img src="{1}" height="24" width="24" alt="" />{2} <span class="notif-when">{3}</span></a></li>
+       <li class="{4}"><a href="{0}"><img data-src="{1}" height="24" width="24" alt="" />{2} <span class="notif-when">{3}</span></a></li>
 </ul>
 <script>
 var pagetitle = null;
index ccc51151d46923a7df7bdf5d9b97744d89b74241..8146ca952f25d0126ac14e93913144112d4d5c22 100644 (file)
@@ -69,7 +69,7 @@
 </nav>
 
 <ul id="nav-notifications-template" style="display:none;" rel="template">
-       <li class="{4}"><a href="{0}"><img src="{1}" height="24" width="24" alt="" />{2} <span class="notif-when">{3}</span></a></li>
+       <li class="{4}"><a href="{0}"><img data-src="{1}" height="24" width="24" alt="" />{2} <span class="notif-when">{3}</span></a></li>
 </ul>
 <script>
 var pagetitle = null;
index 92ce03cb4c560a2885db8257a9e60007b11bcb61..c91a9f56d2190bd1c8b6c5bed43b6660354363df 100644 (file)
 
 
 <ul id="nav-notifications-template" style="display:none;" rel="template">
-       <li class="{4}"><a href="{0}"><img src="{1}">{2} <span class="notif-when">{3}</span></a></li>
+       <li class="{4}"><a href="{0}"><img data-src="{1}">{2} <span class="notif-when">{3}</span></a></li>
 </ul>
 
 
index 2e6198f14cfd09f48dbc734981a2fddef7ca7985..03451410891cac29cca8e36c716f24891daf4ad8 100644 (file)
 
 
 <ul id="nav-notifications-template" style="display:none;" rel="template">
-       <li class="{4}"><a href="{0}"><img src="{1}">{2} <span class="notif-when">{3}</span></a></li>
+       <li class="{4}"><a href="{0}"><img data-src="{1}">{2} <span class="notif-when">{3}</span></a></li>
 </ul>
 
 
index 6af86f51c03d4c476506b2da469d1f6aa4a87921..d0307b60d0fb9e790bfc680992e10871941d3529 100644 (file)
@@ -139,7 +139,7 @@ $langselector
 
 <ul id="nav-notifications-template" style="display:none;" rel="template">
     <li class="{4}">
-    <a href="{0}"><img src="{1}" height="24" width="24" alt="" />{2} <span class="notif-when">{3}</span></a>
+    <a href="{0}"><img data-src="{1}" height="24" width="24" alt="" />{2} <span class="notif-when">{3}</span></a>
     </li>
 </ul>
 
index 51c1fa3d661f24950add2c7437996699b290b5e9..401c2d30be9e3cec363d596bf7b91410fe5821b9 100644 (file)
 
 <ul id="nav-notifications-template" style="display:none;" rel="template">
     <li class="{4}">
-    <a href="{0}"><img src="{1}" height="24" width="24" alt="" />{2} <span class="notif-when">{3}</span></a>
+    <a href="{0}"><img data-src="{1}" height="24" width="24" alt="" />{2} <span class="notif-when">{3}</span></a>
     </li>
 </ul>
 
index 373fb2d368cc06681839c7e966f43e97ec97629f..edffcebf4904755e8bdab4d5aeef502350bd3945 100644 (file)
@@ -66,5 +66,5 @@
 </nav>
 
 <ul id="nav-notifications-template" style="display:none;" rel="template">
-       <li class="{4}"><a href="{0}"><img src="{1}" height="24" width="24" alt="" />{2} <span class="notif-when">{3}</span></a></li>
+       <li class="{4}"><a href="{0}"><img data-src="{1}" height="24" width="24" alt="" />{2} <span class="notif-when">{3}</span></a></li>
 </ul>
index e71e64ea8ab78f6e73ff9ab23ee9f19705aa1f19..2baebda441626253a880916c19b10e87855e1668 100644 (file)
@@ -66,5 +66,5 @@
 </nav>
 
 <ul id="nav-notifications-template" style="display:none;" rel="template">
-       <li class="{4}"><a href="{0}"><img src="{1}" height="24" width="24" alt="" />{2} <span class="notif-when">{3}</span></a></li>
+       <li class="{4}"><a href="{0}"><img data-src="{1}" height="24" width="24" alt="" />{2} <span class="notif-when">{3}</span></a></li>
 </ul>
index 8969accb73544bb8af0d38c18e40b045b22094d2..04c4931fc65eeca3263f329eb9b5e5d1c50c7fdc 100644 (file)
@@ -64,5 +64,5 @@
 </nav>
 
 <ul id="nav-notifications-template" style="display:none;" rel="template">
-       <li class="{4}"><a href="{0}"><img src="{1}" height="24" width="24" alt="" />{2} <span class="notif-when">{3}</span></a></li>
+       <li class="{4}"><a href="{0}"><img data-src="{1}" height="24" width="24" alt="" />{2} <span class="notif-when">{3}</span></a></li>
 </ul>
index 832d9f123cd8eaeb2f8f95c50ff2d2d4fd61d395..7f7bb6290f5103b37f5d5ab2cbb7f1f17de31f10 100644 (file)
@@ -64,5 +64,5 @@
 </nav>
 
 <ul id="nav-notifications-template" style="display:none;" rel="template">
-       <li class="{4}"><a href="{0}"><img src="{1}" height="24" width="24" alt="" />{2} <span class="notif-when">{3}</span></a></li>
+       <li class="{4}"><a href="{0}"><img data-src="{1}" height="24" width="24" alt="" />{2} <span class="notif-when">{3}</span></a></li>
 </ul>
index 327f18b65f8c1584b39c76cf970d6447f68a55fb..df34a1a2aee941a526db545d2a2af7e75db9a820 100644 (file)
@@ -9,7 +9,7 @@
 </div>
 
 <div class="acl-list-item" rel="acl-template" style="display:none">
-       <img src="{0}"><p>{1}</p>
+       <img data-src="{0}"><p>{1}</p>
        <a href="#" class='acl-button-show'>$show</a>
        <a href="#" class='acl-button-hide'>$hide</a>
 </div>
index 65b2d3829816f494743f2bdda54da7ce48dfff64..20f0d461895cc1898d8fd28c8def9b9d1798b0c8 100644 (file)
@@ -253,6 +253,11 @@ ACL.prototype.populate = function(data){
                //console.log(html);
                that.list_content.append(html);
        });
+       $(".acl-list-item img[data-src]").each(function(i, el){
+               // Replace data-src attribute with src attribute for every image
+               $(el).attr('src', $(el).data("src"));
+               $(el).removeAttr("data-src");
+       });
        that.update_view();
 }
 
index 1db338fcdf81c9f1de874acc1ef171728e73175d..197d496646cfcdfab30acc123b7d23d8756ed482 100644 (file)
                                        html = notifications_tpl.format(e.attr('href'),e.attr('photo'), text, e.attr('date'), e.attr('seen'));
                                        nnm.append(html);
                                });
+
+                               $("img[data-src]", nnm).each(function(i, el){
+                                       // Replace data-src attribute with src attribute for every image
+                                       $(el).attr('src', $(el).data("src"));
+                                       $(el).removeAttr("data-src");
+                               });
                        }
                        notif = eNotif.attr('count');
                        if (notif>0){
index 8425640a707d26e79f90815755d56a7b65feeb92..01aafabf0d8c27286e3b79f790f6231f747f9696 100644 (file)
 </nav>
 
 <ul id="nav-notifications-template" style="display:none;" rel="template">
-       <li class="{4}"><a href="{0}"><img src="{1}" height="24" width="24" alt="" />{2} <span class="notif-when">{3}</span></a></li>
+       <li class="{4}"><a href="{0}"><img data-src="{1}" height="24" width="24" alt="" />{2} <span class="notif-when">{3}</span></a></li>
 </ul>
index 5b330de9173a27af3f9a17fcb7f3ddcb3eb3cc2f..f3b1abea7ccfb3e9283d454b10ec48aad4128c49 100644 (file)
@@ -9,7 +9,7 @@
 </div>
 
 <div class="acl-list-item" rel="acl-template" style="display:none">
-       <img src="{0}"><p>{1}</p>
+       <img data-src="{0}"><p>{1}</p>
        <a href="#" class='acl-button-show'>{{$show}}</a>
        <a href="#" class='acl-button-hide'>{{$hide}}</a>
 </div>
index 9e884047081a9245f95495bfcbc79fe276b1a60f..fb5d6223bd6103c675e092de9b68e9ca376d56aa 100644 (file)
 </nav>
 
 <ul id="nav-notifications-template" style="display:none;" rel="template">
-       <li class="{4}"><a href="{0}"><img src="{1}" height="24" width="24" alt="" />{2} <span class="notif-when">{3}</span></a></li>
+       <li class="{4}"><a href="{0}"><img data-src="{1}" height="24" width="24" alt="" />{2} <span class="notif-when">{3}</span></a></li>
 </ul>
index 327f18b65f8c1584b39c76cf970d6447f68a55fb..e79a6891a55dab93e3a93843d930294806c43a29 100644 (file)
@@ -9,7 +9,6 @@
 </div>
 
 <div class="acl-list-item" rel="acl-template" style="display:none">
-       <img src="{0}"><p>{1}</p>
        <a href="#" class='acl-button-show'>$show</a>
        <a href="#" class='acl-button-hide'>$hide</a>
 </div>
index 9675588af238a57d6cd65220425c49a0420072ac..6b443b248165c582b9f87d863d9e4f6bea3598ca 100644 (file)
@@ -253,6 +253,11 @@ ACL.prototype.populate = function(data){
                //console.log(html);
                that.list_content.append(html);
        });
+       $(".acl-list-item img[data-src]").each(function(i, el){
+               // Replace data-src attribute with src attribute for every image
+               $(el).attr('src', $(el).data("src"));
+               $(el).removeAttr("data-src");
+       });
        that.update_view();
 }
 
index 4aaa7ddb74062b277d5f91783101c549348be9c2..91e79ffc383164f9619dd44e4e663fd8a0c7be49 100644 (file)
                                        html = notifications_tpl.format(e.attr('href'),e.attr('photo'), text, e.attr('date'), e.attr('seen'));
                                        nnm.append(html);
                                });
+
+                               $("img[data-src]", nnm).each(function(i, el){
+                                       // Replace data-src attribute with src attribute for every image
+                                       $(el).attr('src', $(el).data("src"));
+                                       $(el).removeAttr("data-src");
+                               });
                        }
                        notif = eNotif.attr('count');
                        if (notif>0){
index ffa4b2fbcf21eebc49a644c803947a34744ab21d..adb9c9f073a7c1b210479ae5f322fc3da276ad66 100644 (file)
 </nav>
 
 <ul id="nav-notifications-template" style="display:none;" rel="template">
-       <li class="{4}"><a href="{0}"><img src="{1}" height="24" width="24" alt="" />{2} <span class="notif-when">{3}</span></a></li>
+       <li class="{4}"><a href="{0}"><img data-src="{1}" height="24" width="24" alt="" />{2} <span class="notif-when">{3}</span></a></li>
 </ul>
index 5b330de9173a27af3f9a17fcb7f3ddcb3eb3cc2f..f3b1abea7ccfb3e9283d454b10ec48aad4128c49 100644 (file)
@@ -9,7 +9,7 @@
 </div>
 
 <div class="acl-list-item" rel="acl-template" style="display:none">
-       <img src="{0}"><p>{1}</p>
+       <img data-src="{0}"><p>{1}</p>
        <a href="#" class='acl-button-show'>{{$show}}</a>
        <a href="#" class='acl-button-hide'>{{$hide}}</a>
 </div>
index 9196c94d6285f598200b58a81737636b2e3c7274..6e1d78dcc7c037295e876d00da9f4aaca12d6900 100644 (file)
 </nav>
 
 <ul id="nav-notifications-template" style="display:none;" rel="template">
-       <li class="{4}"><a href="{0}"><img src="{1}" height="24" width="24" alt="" />{2} <span class="notif-when">{3}</span></a></li>
+       <li class="{4}"><a href="{0}"><img data-src="{1}" height="24" width="24" alt="" />{2} <span class="notif-when">{3}</span></a></li>
 </ul>
index bde9847fcbd3f5394210bf372cce1f98e9ed74d4..ca84e7db54e46215818a94d0802c9de7fd2444ca 100644 (file)
@@ -89,7 +89,7 @@
 
 </nav>
 <ul id="nav-notifications-template" style="display:none;" rel="template">
-       <li><a href="{0}"><img src="{1}">{2} <span class="notif-when">{3}</span></a></li>
+       <li><a href="{0}"><img data-src="{1}">{2} <span class="notif-when">{3}</span></a></li>
 </ul>
 
 <div style="position: fixed; top: 3px; left: 5px; z-index:9999">$langselector</div>
index a31c3d8bb510ff65cde7bf38a02e45242cdb35ba..1e25b0472b1966f21f8fe9196303b0d82601450c 100644 (file)
@@ -89,7 +89,7 @@
 
 </nav>
 <ul id="nav-notifications-template" style="display:none;" rel="template">
-       <li><a href="{0}"><img src="{1}">{2} <span class="notif-when">{3}</span></a></li>
+       <li><a href="{0}"><img data-src="{1}">{2} <span class="notif-when">{3}</span></a></li>
 </ul>
 
 <div style="position: fixed; top: 3px; left: 5px; z-index:9999">{{$langselector}}</div>
index fee2577a509ca173f181e51d9571b1250347486c..b923718da002a2f92511f479a48c158fb847e30c 100644 (file)
@@ -62,7 +62,7 @@
 </div>
 
 <ul id="nav-notifications-template" style="display:none;" rel="template">
-       <li class="{4}"><a href="{0}"><img src="{1}" height="24" width="24" alt="" />{2} <span class="notif-when">{3}</span></a></li>
+       <li class="{4}"><a href="{0}"><img data-src="{1}" height="24" width="24" alt="" />{2} <span class="notif-when">{3}</span></a></li>
 </ul>
 
 <div style="position: fixed; top: 3px; left: 5px; z-index:9999">$langselector</div>
index a89e9b88fba8e09ba36381622b5f5f802792d772..24b9dd20014fa80b71730a262283ea5be789a93a 100644 (file)
@@ -62,7 +62,7 @@
 </div>
 
 <ul id="nav-notifications-template" style="display:none;" rel="template">
-       <li class="{4}"><a href="{0}"><img src="{1}" height="24" width="24" alt="" />{2} <span class="notif-when">{3}</span></a></li>
+       <li class="{4}"><a href="{0}"><img data-src="{1}" height="24" width="24" alt="" />{2} <span class="notif-when">{3}</span></a></li>
 </ul>
 
 <div style="position: fixed; top: 3px; left: 5px; z-index:9999">{{$langselector}}</div>
index 43cc7bca00a3be29a9fa04dcad1120fd5c7584f7..f4c504d365084dc40e7708a1be0bf09825e5255b 100644 (file)
@@ -60,7 +60,7 @@
 
 
 <ul id="nav-notifications-template" style="display:none;" rel="template">
-       <li class="{4}"><a href="{0}"><img src="{1}" height="24" width="24" alt="" />{2} <span class="notif-when">{3}</span></a></li>
+       <li class="{4}"><a href="{0}"><img data-src="{1}" height="24" width="24" alt="" />{2} <span class="notif-when">{3}</span></a></li>
 </ul>
 
 
index 527ecc81965968ecfc4e6258b570264d997772ce..11ce89cb5dc167a48017da026df7ee057e8b22ee 100644 (file)
@@ -60,7 +60,7 @@
 
 
 <ul id="nav-notifications-template" style="display:none;" rel="template">
-       <li class="{4}"><a href="{0}"><img src="{1}" height="24" width="24" alt="" />{2} <span class="notif-when">{3}</span></a></li>
+       <li class="{4}"><a href="{0}"><img data-src="{1}" height="24" width="24" alt="" />{2} <span class="notif-when">{3}</span></a></li>
 </ul>
 
 
index d0d69948ef5e39789473343a6f8e875a6724774c..dd41d844a18dfd8b1144a6e2e9e0652fed81c456 100644 (file)
 
 </nav>
 <ul id="nav-notifications-template" style="display:none;" rel="template">
-       <li><a href="{0}"><img src="{1}">{2} <span class="notif-when">{3}</span></a></li>
+       <li><a href="{0}"><img data-src="{1}">{2} <span class="notif-when">{3}</span></a></li>
 </ul>
 
 {#
index 0379e30ee09eb758ed05aafe5b75103c99e4a6c8..fc9e9c6638ba6a8fae281b37c38ab8d72f7ac728 100644 (file)
 
 </nav>
 <ul id="nav-notifications-template" style="display:none;" rel="template">
-       <li><a href="{0}"><img src="{1}">{2} <span class="notif-when">{3}</span></a></li>
+       <li><a href="{0}"><img data-src="{1}">{2} <span class="notif-when">{3}</span></a></li>
 </ul>
 
 {{*