Set loading="lazy" in mediaBBCodeTag
authorTim Düsterhus <duesterhus@woltlab.com>
Mon, 26 Apr 2021 12:48:25 +0000 (14:48 +0200)
committerTim Düsterhus <duesterhus@woltlab.com>
Mon, 26 Apr 2021 12:48:25 +0000 (14:48 +0200)
see #3980

com.woltlab.wcf/templates/mediaBBCodeTag.tpl
wcfsetup/install/files/acp/templates/mediaBBCodeTag.tpl

index 1aa5412a671cad0b42f0a013902d994c59e1622a..ff303a9342d49626b84ae6d53dd4c2d09dcb7d08 100644 (file)
@@ -1,9 +1,9 @@
 {if !$removeLinks|isset}{assign var='removeLinks' value=false}{/if}
 <span class="mediaBBCode{if $float != 'none'} messageFloatObject{$float|ucfirst}{/if}">
        {if $thumbnailSize != 'original'}
-               {if !$removeLinks}<a href="{$mediaLink}" class="embeddedAttachmentLink jsImageViewer">{/if}<img src="{$thumbnailLink}" alt="{$media->altText}" title="{$media->title}" width="{@$media->getThumbnailWidth($thumbnailSize)}" height="{@$media->getThumbnailHeight($thumbnailSize)}">{if !$removeLinks}</a>{/if}
+               {if !$removeLinks}<a href="{$mediaLink}" class="embeddedAttachmentLink jsImageViewer">{/if}<img src="{$thumbnailLink}" alt="{$media->altText}" title="{$media->title}" width="{@$media->getThumbnailWidth($thumbnailSize)}" height="{@$media->getThumbnailHeight($thumbnailSize)}" loading="lazy">{if !$removeLinks}</a>{/if}
        {else}
-               <img src="{$mediaLink}" alt="{$media->altText}" title="{$media->title}" width="{@$media->width}" height="{@$media->height}">
+               <img src="{$mediaLink}" alt="{$media->altText}" title="{$media->title}" width="{@$media->width}" height="{@$media->height}" loading="lazy">
        {/if}
        
        {if $media->caption}
index 1aa5412a671cad0b42f0a013902d994c59e1622a..ff303a9342d49626b84ae6d53dd4c2d09dcb7d08 100644 (file)
@@ -1,9 +1,9 @@
 {if !$removeLinks|isset}{assign var='removeLinks' value=false}{/if}
 <span class="mediaBBCode{if $float != 'none'} messageFloatObject{$float|ucfirst}{/if}">
        {if $thumbnailSize != 'original'}
-               {if !$removeLinks}<a href="{$mediaLink}" class="embeddedAttachmentLink jsImageViewer">{/if}<img src="{$thumbnailLink}" alt="{$media->altText}" title="{$media->title}" width="{@$media->getThumbnailWidth($thumbnailSize)}" height="{@$media->getThumbnailHeight($thumbnailSize)}">{if !$removeLinks}</a>{/if}
+               {if !$removeLinks}<a href="{$mediaLink}" class="embeddedAttachmentLink jsImageViewer">{/if}<img src="{$thumbnailLink}" alt="{$media->altText}" title="{$media->title}" width="{@$media->getThumbnailWidth($thumbnailSize)}" height="{@$media->getThumbnailHeight($thumbnailSize)}" loading="lazy">{if !$removeLinks}</a>{/if}
        {else}
-               <img src="{$mediaLink}" alt="{$media->altText}" title="{$media->title}" width="{@$media->width}" height="{@$media->height}">
+               <img src="{$mediaLink}" alt="{$media->altText}" title="{$media->title}" width="{@$media->width}" height="{@$media->height}" loading="lazy">
        {/if}
        
        {if $media->caption}