bugfixes for thread watcher count
This commit is contained in:
parent
5b0a1111a9
commit
f65d0833a3
@ -576,10 +576,22 @@ span.hide-announcement {
|
|||||||
}
|
}
|
||||||
#watched-threads > div {
|
#watched-threads > div {
|
||||||
max-width: 250px;
|
max-width: 250px;
|
||||||
overflow: hidden;
|
|
||||||
padding-left: 3px;
|
padding-left: 3px;
|
||||||
padding-right: 3px;
|
padding-right: 3px;
|
||||||
|
display: -webkit-flex;
|
||||||
|
display: flex;
|
||||||
|
-webkit-flex-direction: row;
|
||||||
|
flex-direction: row;
|
||||||
|
}
|
||||||
|
#watched-threads > div > .watched-thread-link {
|
||||||
|
overflow: hidden;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
|
-webkit-flex: 0 1 auto;
|
||||||
|
flex: 0 1 auto;
|
||||||
|
}
|
||||||
|
#watched-threads > div > :not(.watched-thread-link) {
|
||||||
|
-webkit-flex: 0 0 auto;
|
||||||
|
flex: 0 0 auto;
|
||||||
}
|
}
|
||||||
#thread-watcher a {
|
#thread-watcher a {
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
|
|||||||
@ -151,6 +151,7 @@ ThreadWatcher =
|
|||||||
return if unread is data.unread
|
return if unread is data.unread
|
||||||
|
|
||||||
data.unread = unread
|
data.unread = unread
|
||||||
|
ThreadWatcher.db.set {boardID, threadID, val: data}
|
||||||
|
|
||||||
if @status is 404
|
if @status is 404
|
||||||
if Conf['Auto Prune']
|
if Conf['Auto Prune']
|
||||||
@ -176,21 +177,26 @@ ThreadWatcher =
|
|||||||
x = $.el 'a',
|
x = $.el 'a',
|
||||||
className: 'fa fa-times'
|
className: 'fa fa-times'
|
||||||
href: 'javascript:;'
|
href: 'javascript:;'
|
||||||
|
textContent: '\u00A0'
|
||||||
$.on x, 'click', ThreadWatcher.cb.rm
|
$.on x, 'click', ThreadWatcher.cb.rm
|
||||||
|
|
||||||
if Conf['404 Redirect'] and data.isDead
|
if Conf['404 Redirect'] and data.isDead
|
||||||
href = Redirect.to 'thread', {boardID, threadID}
|
href = Redirect.to 'thread', {boardID, threadID}
|
||||||
link = $.el 'a',
|
link = $.el 'a',
|
||||||
href: href or "/#{boardID}/thread/#{threadID}"
|
href: href or "/#{boardID}/thread/#{threadID}"
|
||||||
textContent: data.excerpt + " (#{data.unread})"
|
textContent: data.excerpt
|
||||||
title: data.excerpt
|
title: data.excerpt
|
||||||
|
className: 'watched-thread-link'
|
||||||
|
|
||||||
|
count = $.el 'span',
|
||||||
|
textContent: if data.unread? then "\u00A0(#{data.unread})" else ''
|
||||||
|
|
||||||
div = $.el 'div'
|
div = $.el 'div'
|
||||||
fullID = "#{boardID}.#{threadID}"
|
fullID = "#{boardID}.#{threadID}"
|
||||||
div.dataset.fullID = fullID
|
div.dataset.fullID = fullID
|
||||||
$.addClass div, 'current' if g.VIEW is 'thread' and fullID is "#{g.BOARD}.#{g.THREADID}"
|
$.addClass div, 'current' if g.VIEW is 'thread' and fullID is "#{g.BOARD}.#{g.THREADID}"
|
||||||
$.addClass div, 'dead-thread' if data.isDead
|
$.addClass div, 'dead-thread' if data.isDead
|
||||||
$.add div, [x, $.tn(' '), link]
|
$.add div, [x, link, count]
|
||||||
div
|
div
|
||||||
refresh: ->
|
refresh: ->
|
||||||
nodes = []
|
nodes = []
|
||||||
@ -222,7 +228,7 @@ ThreadWatcher =
|
|||||||
else
|
else
|
||||||
ThreadWatcher.add thread
|
ThreadWatcher.add thread
|
||||||
add: (thread) ->
|
add: (thread) ->
|
||||||
data = {unread: 0}
|
data = {}
|
||||||
boardID = thread.board.ID
|
boardID = thread.board.ID
|
||||||
threadID = thread.ID
|
threadID = thread.ID
|
||||||
if thread.isDead
|
if thread.isDead
|
||||||
@ -282,12 +288,11 @@ ThreadWatcher =
|
|||||||
textContent: 'Open all threads'
|
textContent: 'Open all threads'
|
||||||
refresh: -> (if ThreadWatcher.list.firstElementChild then $.rmClass else $.addClass) @el, 'disabled'
|
refresh: -> (if ThreadWatcher.list.firstElementChild then $.rmClass else $.addClass) @el, 'disabled'
|
||||||
|
|
||||||
# `Check 404'd threads` entry
|
|
||||||
entries.push
|
entries.push
|
||||||
cb: ThreadWatcher.cb.checkThreads
|
cb: ThreadWatcher.cb.checkThreads
|
||||||
entry:
|
entry:
|
||||||
el: $.el 'a',
|
el: $.el 'a',
|
||||||
textContent: 'Check 404\'d threads'
|
textContent: 'Check threads'
|
||||||
refresh: -> (if $('div:not(.dead-thread)', ThreadWatcher.list) then $.rmClass else $.addClass) @el, 'disabled'
|
refresh: -> (if $('div:not(.dead-thread)', ThreadWatcher.list) then $.rmClass else $.addClass) @el, 'disabled'
|
||||||
|
|
||||||
# `Prune 404'd threads` entry
|
# `Prune 404'd threads` entry
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user