Add sticky/closed status icons in the catalog.
This commit is contained in:
parent
154ad07cd7
commit
2024e0c50d
@ -413,11 +413,34 @@ a[href="javascript:;"] {
|
|||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
word-break: break-word;
|
word-break: break-word;
|
||||||
}
|
}
|
||||||
|
.catalog-thread > a {
|
||||||
|
display: inline-block;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
.thumb {
|
.thumb {
|
||||||
max-width: 150px;
|
max-width: 150px;
|
||||||
max-height: 150px;
|
max-height: 150px;
|
||||||
box-shadow: 0 0 5px rgba(0, 0, 0, .25);
|
box-shadow: 0 0 5px rgba(0, 0, 0, .25);
|
||||||
}
|
}
|
||||||
|
.thunb.spoiler-file {
|
||||||
|
width: 100px;
|
||||||
|
height: 100px;
|
||||||
|
}
|
||||||
|
.thumb.deleted-file {
|
||||||
|
width: 127px;
|
||||||
|
height: 13px;
|
||||||
|
padding: 20px 11px;
|
||||||
|
}
|
||||||
|
.thumb.no-file {
|
||||||
|
width: 77px;
|
||||||
|
height: 13px;
|
||||||
|
padding: 20px 36px;
|
||||||
|
}
|
||||||
|
.thread-icons {
|
||||||
|
position: absolute;
|
||||||
|
top: 1px;
|
||||||
|
right: 1px;
|
||||||
|
}
|
||||||
.thread-stats {
|
.thread-stats {
|
||||||
cursor: help;
|
cursor: help;
|
||||||
font-size: 10px;
|
font-size: 10px;
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
<a href="/#{thread.board}/res/#{thread.ID}" target="_blank">
|
<a href="/#{thread.board}/res/#{thread.ID}" target="_blank">
|
||||||
<img src="#{src}" class="thumb" width="#{imgWidth}" height="#{imgHeight}">
|
<img src="#{src}" class="thumb #{imgClass or ''}" #{if imgWidth then "width='#{imgWidth}'"} #{if imgHeight then "height='#{imgHeight}'"}>
|
||||||
|
<div class="thread-icons"></div>
|
||||||
</a>
|
</a>
|
||||||
<div class="thread-stats" title="Post count / File count / Page count">
|
<div class="thread-stats" title="Post count / File count / Page count">
|
||||||
<span class="post-count">#{postCount}</span> / <span class="file-count">#{fileCount}</span> / <span class="page-count">#{pageCount}</span>
|
<span class="post-count">#{postCount}</span> / <span class="file-count">#{fileCount}</span> / <span class="page-count">#{pageCount}</span>
|
||||||
|
|||||||
@ -260,25 +260,28 @@ Build =
|
|||||||
$.add root, nodes
|
$.add root, nodes
|
||||||
root
|
root
|
||||||
threadCatalog: (thread) ->
|
threadCatalog: (thread) ->
|
||||||
|
{staticPath, gifIcon} = Build
|
||||||
for data in Index.liveThreadData
|
for data in Index.liveThreadData
|
||||||
break if data.no is thread.ID
|
break if data.no is thread.ID
|
||||||
|
|
||||||
if data.spoiler and !Conf['Reveal Spoilers']
|
if data.spoiler and !Conf['Reveal Spoilers']
|
||||||
src = "#{Build.staticPath}spoiler"
|
src = "#{staticPath}spoiler"
|
||||||
if spoilerRange = Build.spoilerRange[thread.board]
|
if spoilerRange = Build.spoilerRange[thread.board]
|
||||||
# Randomize the spoiler image.
|
# Randomize the spoiler image.
|
||||||
src += "-#{thread.board}" + Math.floor 1 + spoilerRange * Math.random()
|
src += "-#{thread.board}" + Math.floor 1 + spoilerRange * Math.random()
|
||||||
src += '.png'
|
src += '.png'
|
||||||
imgWidth = imgHeight = 100
|
imgClass = 'spoiler-file'
|
||||||
else if data.filedeleted
|
else if data.filedeleted
|
||||||
src = "#{Build.staticPath}filedeleted-res#{Build.gifIcon}"
|
src = "#{staticPath}filedeleted-res#{gifIcon}"
|
||||||
imgWidth = 127
|
imgClass = 'deleted-file'
|
||||||
imgHeight = 13
|
else if thread.OP.file
|
||||||
else
|
|
||||||
src = thread.OP.file.thumbURL
|
src = thread.OP.file.thumbURL
|
||||||
max = Math.max data.tn_w, data.tn_h
|
max = Math.max data.tn_w, data.tn_h
|
||||||
imgWidth = data.tn_w * 150 / max
|
imgWidth = data.tn_w * 150 / max
|
||||||
imgHeight = data.tn_h * 150 / max
|
imgHeight = data.tn_h * 150 / max
|
||||||
|
else
|
||||||
|
src = "#{staticPath}nofile.png"
|
||||||
|
imgClass = 'no-file'
|
||||||
|
|
||||||
postCount = data.replies + 1
|
postCount = data.replies + 1
|
||||||
fileCount = data.images + !!data.ext
|
fileCount = data.images + !!data.ext
|
||||||
@ -294,6 +297,17 @@ Build =
|
|||||||
className: 'catalog-thread'
|
className: 'catalog-thread'
|
||||||
innerHTML: <%= importHTML('General/Thread-catalog-view') %>
|
innerHTML: <%= importHTML('General/Thread-catalog-view') %>
|
||||||
|
|
||||||
|
if thread.isSticky
|
||||||
|
$.add $('.thread-icons', root), $.el 'img',
|
||||||
|
src: "#{staticPath}sticky#{gifIcon}"
|
||||||
|
className: 'stickyIcon'
|
||||||
|
title: 'Sticky'
|
||||||
|
if thread.isClosed
|
||||||
|
$.add $('.thread-icons', root), $.el 'img',
|
||||||
|
src: "#{staticPath}closed#{gifIcon}"
|
||||||
|
className: 'closedIcon'
|
||||||
|
title: 'Closed'
|
||||||
|
|
||||||
if data.bumplimit
|
if data.bumplimit
|
||||||
$.addClass $('.post-count', root), 'warning'
|
$.addClass $('.post-count', root), 'warning'
|
||||||
if data.imagelimit
|
if data.imagelimit
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user