Replace loading.webp with new marseyloading.
parent
c91f09b83f
commit
dee8eb5154
|
@ -345,7 +345,9 @@ class User(Base):
|
|||
@lazy
|
||||
def bio_html_eager(self):
|
||||
if self.bio_html == None: return ''
|
||||
return self.bio_html.replace('data-src', 'src').replace('src="/assets/images/loading.webp"', '')
|
||||
return self.bio_html.replace('data-src', 'src') \
|
||||
.replace('src="/assets/images/loading.webp?v=2"', '') \
|
||||
.replace('src="/assets/images/loading.webp"', '')
|
||||
|
||||
@property
|
||||
@lazy
|
||||
|
|
|
@ -221,7 +221,7 @@ def sanitize(sanitized, alert=False, edit=False):
|
|||
if tag.get("src") and not tag["src"].startswith('/pp/'):
|
||||
tag["loading"] = "lazy"
|
||||
tag["data-src"] = tag["src"]
|
||||
tag["src"] = "/assets/images/loading.webp"
|
||||
tag["src"] = "/assets/images/loading.webp?v=2"
|
||||
tag['alt'] = f'![]({tag["data-src"]})'
|
||||
tag['referrerpolicy'] = "no-referrer"
|
||||
|
||||
|
|
|
@ -308,3 +308,5 @@
|
|||
}
|
||||
</style>
|
||||
{%- endif %}
|
||||
|
||||
<link rel="preload" as="image" href="/assets/images/loading.webp?v=2">
|
||||
|
|
|
@ -347,7 +347,7 @@
|
|||
{% if p.is_image and not p.over_18 and ((v and v.cardview) or (not v and environ.get('CARD_VIEW') == '1')) %}
|
||||
<div style="text-align: center" class="mt-3 mb-4">
|
||||
<a {% if v and v.newtab and not g.webview %}target="_blank"{% endif %} rel="nofollow noopener noreferrer" href="{{p.realurl(v)}}">
|
||||
<img loading="lazy" data-src="{{p.realurl(v)}}" src="/assets/images/loading.webp" class="img-fluid" style="max-height:20rem" alt="Unable to load image">
|
||||
<img loading="lazy" data-src="{{p.realurl(v)}}" src="/assets/images/loading.webp?v=2" class="img-fluid" style="max-height:20rem" alt="Unable to load image">
|
||||
</a>
|
||||
</div>
|
||||
{% elif p.is_video %}
|
||||
|
|
Loading…
Reference in New Issue