Replace loading.webp with new marseyloading.

remotes/1693045480750635534/spooky-22
Snakes 2022-06-19 22:15:33 -04:00
parent c91f09b83f
commit dee8eb5154
4 changed files with 7 additions and 3 deletions

View File

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

View File

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

View File

@ -308,3 +308,5 @@
}
</style>
{%- endif %}
<link rel="preload" as="image" href="/assets/images/loading.webp?v=2">

View File

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