forked from rDrama/rDrama
1
0
Fork 0

Replace loading.webp with new marseyloading.

master
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 @lazy
def bio_html_eager(self): def bio_html_eager(self):
if self.bio_html == None: return '' 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 @property
@lazy @lazy

View File

@ -221,7 +221,7 @@ def sanitize(sanitized, alert=False, edit=False):
if tag.get("src") and not tag["src"].startswith('/pp/'): if tag.get("src") and not tag["src"].startswith('/pp/'):
tag["loading"] = "lazy" tag["loading"] = "lazy"
tag["data-src"] = tag["src"] 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['alt'] = f'![]({tag["data-src"]})'
tag['referrerpolicy'] = "no-referrer" tag['referrerpolicy'] = "no-referrer"

View File

@ -308,3 +308,5 @@
} }
</style> </style>
{%- endif %} {%- 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')) %} {% 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"> <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)}}"> <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> </a>
</div> </div>
{% elif p.is_video %} {% elif p.is_video %}