From ab42ad240968c4b85f2b61bd99d729d32b54a524 Mon Sep 17 00:00:00 2001 From: Mayhem Date: Tue, 28 Jan 2014 09:59:49 +0100 Subject: [PATCH] Shift+click to hide threads in the catalog. Conflicts: src/Filtering/ThreadHiding.coffee --- src/Filtering/Filter.coffee | 3 ++- src/Filtering/ThreadHiding.coffee | 2 +- src/General/Build.coffee | 2 +- src/General/lib/thread.class | 11 +++++++++++ 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/Filtering/Filter.coffee b/src/Filtering/Filter.coffee index ec6e0e9c1..ca3551f36 100755 --- a/src/Filtering/Filter.coffee +++ b/src/Filtering/Filter.coffee @@ -113,7 +113,8 @@ Filter = # Highlight $.addClass @nodes.root, result.class - @thread.highlight = result.class + unless result.class in @highlights + (@highlights or= []).push result.class if !@isReply and result.top @thread.isOnTop = true diff --git a/src/Filtering/ThreadHiding.coffee b/src/Filtering/ThreadHiding.coffee index e0ed48f41..8eb7ad224 100755 --- a/src/Filtering/ThreadHiding.coffee +++ b/src/Filtering/ThreadHiding.coffee @@ -1,6 +1,6 @@ ThreadHiding = init: -> - return if g.VIEW isnt 'index' or !Conf['Thread Hiding Buttons'] and !Conf['Thread Hiding Link'] + return if g.VIEW isnt 'index' @db = new DataBoard 'hiddenThreads' @syncCatalog() diff --git a/src/General/Build.coffee b/src/General/Build.coffee index e6c4faf63..c74bf8dc2 100755 --- a/src/General/Build.coffee +++ b/src/General/Build.coffee @@ -363,7 +363,7 @@ Build = '
&{thread.OP.nodes.comment}
' ) %> - $.addClass root, thread.highlight if thread.highlight + $.addClass root, thread.OP.highlights... if thread.OP.highlights if thread.isSticky $.add $('.thread-icons', root), $.el 'img', diff --git a/src/General/lib/thread.class b/src/General/lib/thread.class index 1deb7c239..f351c5257 100755 --- a/src/General/lib/thread.class +++ b/src/General/lib/thread.class @@ -55,6 +55,17 @@ class Thread getCatalogView: -> return @catalogView if @catalogView @catalogView = Build.threadCatalog @ + $.on $('.thumb', @catalogView), 'click', @onCatalogViewClick + @catalogView + onCatalogViewClick: (e) => + return if e.button isnt 0 + if e.shiftKey + $.rm @catalogView + ThreadHiding.hide @ + ThreadHiding.saveHiddenState @ + else + return + e.preventDefault() kill: -> @isDead = true