]> git.mxchange.org Git - friendica.git/commitdiff
Fix browser prefetch in notifications menu
authorOlaf Conradi <olaf@conradi.org>
Sat, 29 Dec 2012 23:28:48 +0000 (00:28 +0100)
committerOlaf Conradi <olaf@conradi.org>
Sat, 29 Dec 2012 23:28:48 +0000 (00:28 +0100)
Fix browser prefetch by substituting data-src with src for images

27 files changed:
js/main.js
view/nav.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/js/main.js
view/theme/frost-mobile/nav.tpl
view/theme/frost-mobile/smarty3/nav.tpl
view/theme/frost/js/main.js
view/theme/frost/nav.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 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 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 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 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 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 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 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>
 
 {{*