From 29d37253bd19b5462216fdee35c29291d76f800a Mon Sep 17 00:00:00 2001 From: Chris Date: Sat, 23 Jan 2021 13:48:23 -0500 Subject: [PATCH 1/3] Added option to open dead threads --- src/Monitoring/ThreadWatcher.coffee | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/Monitoring/ThreadWatcher.coffee b/src/Monitoring/ThreadWatcher.coffee index 187f15dfb..f1c90175d 100644 --- a/src/Monitoring/ThreadWatcher.coffee +++ b/src/Monitoring/ThreadWatcher.coffee @@ -126,6 +126,12 @@ ThreadWatcher = for a in $$ 'a[title]', ThreadWatcher.list $.open a.href $.event 'CloseMenu' + openDeads: -> + return if $.hasClass @, 'disabled' + for a in $$ 'a[title]', ThreadWatcher.list + if a.parentNode.classList.contains("dead-thread") + $.open a.href + $.event 'CloseMenu' pruneDeads: -> return if $.hasClass @, 'disabled' for {siteID, boardID, threadID, data} in ThreadWatcher.getAll() when data.isDead @@ -605,6 +611,14 @@ ThreadWatcher = @el.classList.toggle 'disabled', !ThreadWatcher.list.firstElementChild true + # `Open dead threads` entry + entries.push + text: 'Open dead threads' + cb: ThreadWatcher.cb.openDeads + open: -> + @el.classList.toggle 'disabled', !$('.dead-thread', ThreadWatcher.list) + true + # `Prune dead threads` entry entries.push text: 'Prune dead threads' From 93e9510fe53a8aff17138e72b323a01a6b661ef5 Mon Sep 17 00:00:00 2001 From: Jeff Sandberg Date: Thu, 25 Feb 2021 12:27:37 -0700 Subject: [PATCH 2/3] Add a menu item to open unread in ThreadWatcher --- src/Monitoring/ThreadWatcher.coffee | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/Monitoring/ThreadWatcher.coffee b/src/Monitoring/ThreadWatcher.coffee index 187f15dfb..641e9b9ca 100644 --- a/src/Monitoring/ThreadWatcher.coffee +++ b/src/Monitoring/ThreadWatcher.coffee @@ -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' pruneDeads: -> return if $.hasClass @, 'disabled' for {siteID, boardID, threadID, data} in ThreadWatcher.getAll() when data.isDead @@ -605,6 +610,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 + # `Prune dead threads` entry entries.push text: 'Prune dead threads' From 227bd828f8ebdb803a505a4995dcdc25071eff4a Mon Sep 17 00:00:00 2001 From: ccd0 Date: Sat, 8 May 2021 07:38:34 -0700 Subject: [PATCH 3/3] Clean up selectors for Thread Watcher open thread links. --- src/Monitoring/ThreadWatcher.coffee | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/Monitoring/ThreadWatcher.coffee b/src/Monitoring/ThreadWatcher.coffee index 71e218342..00e0caf61 100644 --- a/src/Monitoring/ThreadWatcher.coffee +++ b/src/Monitoring/ThreadWatcher.coffee @@ -123,19 +123,18 @@ ThreadWatcher = cb: openAll: -> return if $.hasClass @, 'disabled' - for a in $$ 'a[title]', ThreadWatcher.list + for a in $$ 'a.watcher-link', ThreadWatcher.list $.open a.href $.event 'CloseMenu' openUnread: -> return if $.hasClass @, 'disabled' - for a in $$ '.replies-unread a[title]', ThreadWatcher.list + for a in $$ '.replies-unread > a.watcher-link', ThreadWatcher.list $.open a.href $.event 'CloseMenu' openDeads: -> return if $.hasClass @, 'disabled' - for a in $$ 'a[title]', ThreadWatcher.list - if a.parentNode.classList.contains("dead-thread") - $.open a.href + for a in $$ '.dead-thread > a.watcher-link', ThreadWatcher.list + $.open a.href $.event 'CloseMenu' pruneDeads: -> return if $.hasClass @, 'disabled'