Fix banner triggering download with Firefox

This commit is contained in:
Zed 2019-09-08 01:43:54 +02:00
parent cc58ad95ac
commit c7a2387aeb
3 changed files with 5 additions and 6 deletions

View file

@ -553,7 +553,7 @@ video, .video-container img {
.profile-card-avatar { .profile-card-avatar {
display: block; display: block;
width: 100%; width: 100%;
padding-bottom: 16px; padding-bottom: 6px;
margin-right: 4px; margin-right: 4px;
} }
@ -1330,7 +1330,6 @@ legend {
} }
.profile-card-avatar { .profile-card-avatar {
padding-bottom: 6px;
height: 60px; height: 60px;
width: unset; width: unset;
} }
@ -1363,6 +1362,5 @@ legend {
.preferences-container { .preferences-container {
max-width: 95vw; max-width: 95vw;
margin: 0;
} }
} }

View file

@ -6,7 +6,7 @@ const key = "supersecretkey"
proc mimetype*(filename: string): string = proc mimetype*(filename: string): string =
if ".png" in filename: if ".png" in filename:
"image/" & "png" "image/" & "png"
elif ".jpg" in filename or ".jpeg" in filename: elif ".jpg" in filename or ".jpeg" in filename or "1500x500" in filename:
"image/" & "jpg" "image/" & "jpg"
elif ".mp4" in filename: elif ".mp4" in filename:
"video/" & "mp4" "video/" & "mp4"

View file

@ -14,7 +14,8 @@ proc renderStat(num, class: string; text=""): VNode =
proc renderProfileCard*(profile: Profile; prefs: Prefs): VNode = proc renderProfileCard*(profile: Profile; prefs: Prefs): VNode =
buildHtml(tdiv(class="profile-card")): buildHtml(tdiv(class="profile-card")):
tdiv(class="profile-card-info"): tdiv(class="profile-card-info"):
a(class="profile-card-avatar", href=profile.getUserPic().getSigUrl("pic")): let url = profile.getUserPic().getSigUrl("pic")
a(class="profile-card-avatar", href=url, target="_blank"):
genImg(profile.getUserpic("_200x200")) genImg(profile.getUserpic("_200x200"))
tdiv(class="profile-card-tabs-name"): tdiv(class="profile-card-tabs-name"):
@ -71,7 +72,7 @@ proc renderBanner(profile: Profile): VNode =
if "#" in profile.banner: if "#" in profile.banner:
tdiv(class="profile-banner-color", style={backgroundColor: profile.banner}) tdiv(class="profile-banner-color", style={backgroundColor: profile.banner})
else: else:
a(href=getSigUrl(profile.banner, "pic")): a(href=getSigUrl(profile.banner, "pic"), target="_blank"):
genImg(profile.banner) genImg(profile.banner)
proc renderProfile*(profile: Profile; timeline: Timeline; proc renderProfile*(profile: Profile; timeline: Timeline;