perf(feed): lazy load

This commit is contained in:
Anonymous 2024-01-06 21:30:59 +03:00 committed by GitHub
parent d60df69825
commit 64827402ee
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 38 additions and 38 deletions

View file

@ -17,7 +17,7 @@
{/block}
{block preview}
<img src="{$x->getThumbnailURL()}" width="75" alt="{$x->getName(tr('__lang'))}" />
<img src="{$x->getThumbnailURL()}" width="75" alt="{$x->getName(tr('__lang'))}" loading=lazy />
{/block}
{block name}

View file

@ -14,7 +14,7 @@
{block content}
<div class="gift_grid">
<div n:foreach="$gifts as $gift" n:class="gift_sel, !$gift->canUse($thisUser) ? disabled" data-gift="{$gift->getId()}">
<img class="gift_pic" src="{$gift->getImage(2)}" alt="{_gift}" />
<img class="gift_pic" src="{$gift->getImage(2)}" alt="{_gift}" loading=lazy />
<strong class="gift_price">
{if $gift->isFree()}

View file

@ -16,7 +16,7 @@
{/block}
{block preview}
<img src="{$x->gift->getImage(2)}" width="75" alt="{_gift}" />
<img src="{$x->gift->getImage(2)}" width="75" alt="{_gift}" loading=lazy />
{/block}
{block name}

View file

@ -289,7 +289,7 @@
<img
src="{is_null($cover)?'/assets/packages/static/openvk/img/camera_200.png':$cover->getURL()}"
style="max-width: 80px; max-height: 54pt;" />
style="max-width: 80px; max-height: 54pt;" loading=lazy />
</div>
<div>
<b><a href="/album{$album->getPrettyId()}">{$album->getName()}</a></b><br>

View file

@ -26,7 +26,7 @@
<div class="crp-entry--image">
<img src="{$recipient->getAvatarURL('miniscule')}"
alt="Фотография пользователя" />
alt="Фотография пользователя" loading=lazy />
</div>
<div class="crp-entry--info">
<a href="{$recipient->getURL()}">{$recipient->getCanonicalName()}</a><br/>

View file

@ -41,7 +41,7 @@
</a>
<a href="/photo{$photo->getPrettyId()}?from=album{$album->getId()}">
<img class="album-photo--image" src="{$photo->getURLBySizeId('tinier')}" alt="{$photo->getDescription()}" />
<img class="album-photo--image" src="{$photo->getURLBySizeId('tinier')}" alt="{$photo->getDescription()}" loading=lazy />
</a>
</div>
{/foreach}

View file

@ -48,7 +48,7 @@
{var $preview = is_null($cover) ? "/assets/packages/static/openvk/img/camera_200.png" : $cover->getURLBySizeId("normal")}
<a href="/album{$x->getPrettyId()}">
<img src="{$preview}" alt="{$x->getName()}" style="height: 130px; width: 170px; object-fit: cover" />
<img src="{$preview}" alt="{$x->getName()}" style="height: 130px; width: 170px; object-fit: cover" loading=lazy />
</a>
{/block}

View file

@ -22,7 +22,7 @@
{/block}
{block preview}
<img src="{$x->getAvatarUrl('miniscule')}" width="75" alt="Фотография пользователя" />
<img src="{$x->getAvatarUrl('miniscule')}" width="75" alt="Фотография пользователя" loading=lazy />
{/block}
{block name}

View file

@ -23,7 +23,7 @@
{/block}
{block preview}
<img src="{$x->getAvatarUrl('miniscule')}" width="75" alt="{_photo}" />
<img src="{$x->getAvatarUrl('miniscule')}" width="75" alt="{_photo}" loading=lazy />
{/block}
{block name}

View file

@ -97,7 +97,7 @@
{/block}
{block preview}
<img src="{$x->getAvatarUrl('miniscule')}" width="75" alt="Фотография пользователя" />
<img src="{$x->getAvatarUrl('miniscule')}" width="75" alt="Фотография пользователя" loading=lazy />
{/block}
{block name}

View file

@ -48,7 +48,7 @@
{/block}
{block preview}
<img src="{$x->getAvatarUrl('miniscule')}" width="75" alt="Фотография группы" />
<img src="{$x->getAvatarUrl('miniscule')}" width="75" alt="Фотография группы" loading=lazy />
{/block}
{block name}{/block}

View file

@ -304,7 +304,7 @@
<img
src="{is_null($cover)?'/assets/packages/static/openvk/img/camera_200.png':$cover->getURLBySizeId('small')}"
style="max-width: 80px; max-height: 54pt;" />
style="max-width: 80px; max-height: 54pt;" loading=lazy />
</div>
<div style="overflow: hidden; overflow-wrap: break-word;">
<b><a href="/album{$album->getPrettyId()}">{$album->getName()}</a></b><br>
@ -656,7 +656,7 @@
<img style="width: 70px; max-height: 70px;"
src="{$giftDescriptor->gift->getImage(2)}"
alt="{$hideInfo ? tr('gift') : ($giftDescriptor->caption ?? tr('gift'))}"
title="{$hideInfo ? tr('gift') : ($giftDescriptor->caption ?? tr('gift'))}" />
title="{$hideInfo ? tr('gift') : ($giftDescriptor->caption ?? tr('gift'))}" loading=lazy />
</a>
</div>
</div>

View file

@ -2,7 +2,7 @@
{if !$attachment->isDeleted()}
{var $link = "/photo" . ($attachment->isAnonymous() ? ("s/" . base_convert((string) $attachment->getId(), 10, 32)) : $attachment->getPrettyId())}
<a href="{$link}" onclick="OpenMiniature(event, {$attachment->getURLBySizeId('normal')}, {$parent->getPrettyId()}, {$attachment->getPrettyId()}, {$parentType})">
<img class="media media_makima" src="{$attachment->getURLBySizeId('normal')}" alt="{$attachment->getDescription()}" />
<img class="media media_makima" src="{$attachment->getURLBySizeId('normal')}" alt="{$attachment->getDescription()}" loading=lazy />
</a>
{else}
<a href="javascript:alert('{_attach_no_longer_available}');">

View file

@ -14,7 +14,7 @@
<tr>
<td width="54" valign="top">
<a href="{$author->getURL()}">
<img src="{$author->getAvatarURL('miniscule')}" class="post-avatar" width="50" />
<img src="{$author->getAvatarURL('miniscule')}" class="post-avatar" width="50" loading=lazy />
<span n:if="!$post->isPostedOnBehalfOfGroup() && !($compact ?? false) && $author->isOnline()" class="post-online">{_online}</span>
</a>
</td>