Merge remote-tracking branch 'paradox460/add-open-unread-to-watch'

This commit is contained in:
ccd0 2021-05-08 07:20:17 -07:00
commit 096086cc28

View File

@ -126,6 +126,11 @@ ThreadWatcher =
for a in $$ 'a[title]', ThreadWatcher.list
$.open a.href
$.event 'CloseMenu'
openUnread: ->
return if $.hasClass @, 'disabled'
for a in $$ '.replies-unread a[title]', ThreadWatcher.list
$.open a.href
$.event 'CloseMenu'
openDeads: ->
return if $.hasClass @, 'disabled'
for a in $$ 'a[title]', ThreadWatcher.list
@ -611,6 +616,14 @@ ThreadWatcher =
@el.classList.toggle 'disabled', !ThreadWatcher.list.firstElementChild
true
# `Open Unread` entry
entries.push
text: 'Open unread threads'
cb: ThreadWatcher.cb.openUnread
open: ->
@el.classList.toggle 'disabled', !$('.replies-unread', ThreadWatcher.list)
true
# `Open dead threads` entry
entries.push
text: 'Open dead threads'