try making hats work in popover

remotes/1693045480750635534/spooky-22
Aevann1 2022-09-05 06:21:06 +02:00
parent b3b6f1cf34
commit 15732114d9
8 changed files with 8 additions and 6 deletions

View File

@ -80,7 +80,7 @@ socket.on('speak', function(json) {
document.getElementsByClassName('userlink')[0].classList.remove('d-none')
document.getElementsByClassName('avatar')[0].classList.remove('d-none')
document.getElementsByClassName('avatar-pic')[0].src = json['avatar']
if (json['hat']) document.getElementsByClassName('avatar-hat')[0].src = `/i/hats/${json['hat']}?v=3`
if (json['hat']) document.getElementsByClassName('avatar-hat')[0].src = `/i/hats/${json['hat']}.webp?v=3`
document.getElementsByClassName('userlink')[0].href = '/@' + json['username']
document.getElementsByClassName('userlink')[0].style.color = '#' + json['namecolor']
document.getElementsByClassName('time')[0].classList.remove('d-none')

View File

@ -49,6 +49,7 @@ function popclick(e) {
popover.getElementsByClassName('pop-banner')[0].src = author["bannerurl"]
popover.getElementsByClassName('pop-picture')[0].src = author["profile_url"]
if (author["hat"]) popover.getElementsByClassName('pop-hat')[0].src = `/i/hats/${author['hat']}.webp?v=3`
popover.getElementsByClassName('pop-username')[0].innerHTML = author["username"]
if (popover.getElementsByClassName('pop-bio').length > 0) {
popover.getElementsByClassName('pop-bio')[0].innerHTML = author["bio_html"]

View File

@ -693,6 +693,7 @@ class User(Base):
'url': self.url,
'id': self.id,
'profile_url': self.profile_url,
'hat': self.hat_active.name,
'bannerurl': self.banner_url,
'bio_html': self.bio_html_eager,
'coins': self.coins,

View File

@ -66,7 +66,7 @@ def speak(data, v):
data={
"avatar": v.profile_url,
"hat": v.hat_active,
"hat": v.hat_active.name,
"username": v.username,
"namecolor": v.namecolor,
"text": text,

View File

@ -222,6 +222,6 @@
<script src="{{asset('js/lozad.js')}}"></script>
<script src="/assets/js/lite-youtube.js?v=4000"></script>
<script src="/chat.js?v=4002"></script>
<script src="/chat.js?v=4003"></script>
</body>

View File

@ -22,7 +22,7 @@
const profile_pic_hat = document.getElementById("profile-pic-35-hat");
function extra_actions(xhr) {
if(xhr.status == 200) {
profile_pic_hat.src = `/i/hats/${hat_name}.webp?v=1`
profile_pic_hat.src = `/i/hats/${hat_name}.webp?v=3`
profile_pic_hat.classList.remove('d-none')
}
}

View File

@ -4,7 +4,7 @@
<div class="d-flex align-items-end px-3 mt-n6 mb-3">
<div class="profile-pic-72-wrapper">
<img loading="lazy" class="pop-picture avatar-72 rounded img-thumbnail shadow-sm">
<img class="profile-pic-72-hat hat" loading="lazy" data-bs-toggle="tooltip" data-bs-placement="bottom">
<img class="pop-hat profile-pic-72-hat hat" loading="lazy">
</div>
<div class="px-3 text-truncate">
<h5 class="pop-username text-truncate text-black"></h5>

View File

@ -18,7 +18,7 @@ set CACHE_VER = {
'js/award_modal.js': 4000,
'js/bootstrap.js': 4000,
'js/category_modal.js': 4000,
'js/comments+submission_listing.js': 4000,
'js/comments+submission_listing.js': 4001,
'js/comments_admin.js': 4000,
'js/comments_v.js': 4000,
'js/submission_listing.js': 4000,