Browse Source

Fix browser prefetch in notifications menu

Fix browser prefetch by substituting data-src with src for images
pull/569/head
Olaf Conradi 9 years ago
parent
commit
dbf8f711cf
  1. 10
      js/main.js
  2. 2
      view/nav.tpl
  3. 2
      view/smarty3/nav.tpl
  4. 2
      view/theme/cleanzero/nav.tpl
  5. 2
      view/theme/cleanzero/smarty3/nav.tpl
  6. 2
      view/theme/diabook/nav.tpl
  7. 2
      view/theme/diabook/smarty3/nav.tpl
  8. 2
      view/theme/dispy/nav.tpl
  9. 2
      view/theme/dispy/smarty3/nav.tpl
  10. 2
      view/theme/duepuntozero/nav.tpl
  11. 2
      view/theme/duepuntozero/smarty3/nav.tpl
  12. 2
      view/theme/facepark/nav.tpl
  13. 2
      view/theme/facepark/smarty3/nav.tpl
  14. 6
      view/theme/frost-mobile/js/main.js
  15. 2
      view/theme/frost-mobile/nav.tpl
  16. 2
      view/theme/frost-mobile/smarty3/nav.tpl
  17. 6
      view/theme/frost/js/main.js
  18. 2
      view/theme/frost/nav.tpl
  19. 2
      view/theme/frost/smarty3/nav.tpl
  20. 2
      view/theme/quattro/nav.tpl
  21. 2
      view/theme/quattro/smarty3/nav.tpl
  22. 2
      view/theme/smoothly/nav.tpl
  23. 2
      view/theme/smoothly/smarty3/nav.tpl
  24. 2
      view/theme/testbubble/nav.tpl
  25. 2
      view/theme/testbubble/smarty3/nav.tpl
  26. 2
      view/theme/vier/nav.tpl
  27. 2
      view/theme/vier/smarty3/nav.tpl

10
js/main.js

@ -181,7 +181,14 @@
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");
@ -202,8 +209,7 @@
});
});
NavUpdate();
// Allow folks to stop the ajax page updates with the pause/break key
$(document).keydown(function(event) {

2
view/nav.tpl

@ -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>

2
view/smarty3/nav.tpl

@ -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>

2
view/theme/cleanzero/nav.tpl

@ -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;

2
view/theme/cleanzero/smarty3/nav.tpl

@ -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;

2
view/theme/diabook/nav.tpl

@ -144,7 +144,7 @@
<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>

2
view/theme/diabook/smarty3/nav.tpl

@ -144,7 +144,7 @@
<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>

2
view/theme/dispy/nav.tpl

@ -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>

2
view/theme/dispy/smarty3/nav.tpl

@ -139,7 +139,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>
<a href="{0}"><img data-src="{1}" height="24" width="24" alt="" />{2} <span class="notif-when">{3}</span></a>
</li>
</ul>

2
view/theme/duepuntozero/nav.tpl

@ -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>

2
view/theme/duepuntozero/smarty3/nav.tpl

@ -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>

2
view/theme/facepark/nav.tpl

@ -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>

2
view/theme/facepark/smarty3/nav.tpl

@ -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>

6
view/theme/frost-mobile/js/main.js

@ -187,6 +187,12 @@
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){

2
view/theme/frost-mobile/nav.tpl

@ -142,5 +142,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>

2
view/theme/frost-mobile/smarty3/nav.tpl

@ -142,5 +142,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>

6
view/theme/frost/js/main.js

@ -179,6 +179,12 @@
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){

2
view/theme/frost/nav.tpl

@ -146,5 +146,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>

2
view/theme/frost/smarty3/nav.tpl

@ -146,5 +146,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>

2
view/theme/quattro/nav.tpl

@ -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>

2
view/theme/quattro/smarty3/nav.tpl

@ -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>

2
view/theme/smoothly/nav.tpl

@ -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>

2
view/theme/smoothly/smarty3/nav.tpl

@ -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>

2
view/theme/testbubble/nav.tpl

@ -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>

2
view/theme/testbubble/smarty3/nav.tpl

@ -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>

2
view/theme/vier/nav.tpl

@ -104,7 +104,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>
{#

2
view/theme/vier/smarty3/nav.tpl

@ -104,7 +104,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>
{{*

Loading…
Cancel
Save