Support hidpi post icons.
This commit is contained in:
parent
9c81b6e459
commit
feb8e09c5a
@ -60,6 +60,10 @@ Build =
|
||||
isOP = postID is threadID
|
||||
|
||||
staticPath = '//static.4chan.org/image/'
|
||||
gifIcon = if window.devicePixelRatio >= 2
|
||||
'@2x.gif'
|
||||
else
|
||||
'.gif'
|
||||
|
||||
if email
|
||||
emailStart = '<a href="mailto:' + email + '" class="useremail">'
|
||||
@ -82,21 +86,21 @@ Build =
|
||||
capcodeClass = " capcodeAdmin"
|
||||
capcodeStart = " <strong class='capcode hand id_admin'" +
|
||||
"title='Highlight posts by the Administrator'>## Admin</strong>"
|
||||
capcode = " <img src='#{staticPath}adminicon.gif' " +
|
||||
capcode = " <img src='#{staticPath}adminicon#{gifIcon}' " +
|
||||
"alt='This user is the 4chan Administrator.' " +
|
||||
"title='This user is the 4chan Administrator.' class=identityIcon>"
|
||||
when 'mod'
|
||||
capcodeClass = " capcodeMod"
|
||||
capcodeStart = " <strong class='capcode hand id_mod' " +
|
||||
"title='Highlight posts by Moderators'>## Mod</strong>"
|
||||
capcode = " <img src='#{staticPath}modicon.gif' " +
|
||||
capcode = " <img src='#{staticPath}modicon#{gifIcon}' " +
|
||||
"alt='This user is a 4chan Moderator.' " +
|
||||
"title='This user is a 4chan Moderator.' class=identityIcon>"
|
||||
when 'developer'
|
||||
capcodeClass = " capcodeDeveloper"
|
||||
capcodeStart = " <strong class='capcode hand id_developer' " +
|
||||
"title='Highlight posts by Developers'>## Developer</strong>"
|
||||
capcode = " <img src='#{staticPath}developericon.gif' " +
|
||||
capcode = " <img src='#{staticPath}developericon#{gifIcon}' " +
|
||||
"alt='This user is a 4chan Developer.' " +
|
||||
"title='This user is a 4chan Developer.' class=identityIcon>"
|
||||
else
|
||||
@ -114,11 +118,11 @@ Build =
|
||||
if file?.isDeleted
|
||||
fileHTML = if isOP
|
||||
"<div class=file id=f#{postID}><div class=fileInfo></div><span class=fileThumb>" +
|
||||
"<img src='#{staticPath}filedeleted.gif' alt='File deleted.' class=fileDeletedRes>" +
|
||||
"<img src='#{staticPath}filedeleted#{gifIcon}' alt='File deleted.' class=fileDeletedRes>" +
|
||||
"</span></div>"
|
||||
else
|
||||
"<div class=file id=f#{postID}><span class=fileThumb>" +
|
||||
"<img src='#{staticPath}filedeleted-res.gif' alt='File deleted.' class=fileDeletedRes>" +
|
||||
"<img src='#{staticPath}filedeleted-res#{gifIcon}' alt='File deleted.' class=fileDeletedRes>" +
|
||||
"</span></div>"
|
||||
else if file
|
||||
ext = file.name[-3..]
|
||||
@ -178,11 +182,11 @@ Build =
|
||||
''
|
||||
|
||||
sticky = if isSticky
|
||||
" <img src=#{staticPath}sticky.gif alt=Sticky title=Sticky class=stickyIcon>"
|
||||
" <img src=#{staticPath}sticky#{gifIcon} alt=Sticky title=Sticky class=stickyIcon>"
|
||||
else
|
||||
''
|
||||
closed = if isClosed
|
||||
" <img src=#{staticPath}closed.gif alt=Closed title=Closed class=closedIcon>"
|
||||
" <img src=#{staticPath}closed#{gifIcon} alt=Closed title=Closed class=closedIcon>"
|
||||
else
|
||||
''
|
||||
|
||||
|
||||
@ -22,7 +22,7 @@ class Thread
|
||||
$.rm $ ".#{typeLC}Icon", @OP.nodes.info
|
||||
return
|
||||
icon = $.el 'img',
|
||||
src: "//static.4chan.org/image/#{typeLC}.gif"
|
||||
src: "//static.4chan.org/image/#{typeLC}#{if window.devicePixelRatio >= 2 then '@2x' else ''}.gif"
|
||||
alt: type
|
||||
title: type
|
||||
className: "#{typeLC}Icon"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user