diff --git a/src/Filtering/Filter.coffee b/src/Filtering/Filter.coffee index 0fb24d79d..47c124f7e 100644 --- a/src/Filtering/Filter.coffee +++ b/src/Filtering/Filter.coffee @@ -171,6 +171,7 @@ Filter = quickFilterMD5: -> post = Get.postFromNode @ + return unless post.file Filter.addFilter 'MD5', "/#{post.file.MD5}/" origin = post.origin or post if origin.isReply diff --git a/src/Miscellaneous/Keybinds.coffee b/src/Miscellaneous/Keybinds.coffee index fe9c9abbb..523a6e7e6 100644 --- a/src/Miscellaneous/Keybinds.coffee +++ b/src/Miscellaneous/Keybinds.coffee @@ -199,6 +199,11 @@ Keybinds = return unless thread and ThreadHiding.db Header.scrollTo threadRoot ThreadHiding.toggle thread + when Conf['Quick Filter MD5'] + return unless threadRoot + post = Keybinds.post threadRoot + Keybinds.hl +1, threadRoot + Filter.quickFilterMD5.call post when Conf['Previous Post Quoting You'] return unless threadRoot and QuoteYou.db QuoteYou.cb.seek 'preceding' @@ -255,10 +260,13 @@ Keybinds = if e.shiftKey then key = 'Shift+' + key key + post: (thread) -> + $('.post.highlight', thread) or $('.op', thread) + qr: (thread) -> QR.open() if thread? - QR.quote.call $ 'input', $('.post.highlight', thread) or thread + QR.quote.call Keybinds.post thread QR.nodes.com.focus() tags: (tag, ta) -> @@ -297,8 +305,8 @@ Keybinds = if all ImageExpand.cb.toggleAll() else - post = Get.postFromNode $('.post.highlight', thread) or $ '.op', thread - ImageExpand.toggle post + post = Get.postFromNode Keybinds.post thread + ImageExpand.toggle post if post.file open: (thread, tab) -> return if g.VIEW isnt 'index' diff --git a/src/config/Config.coffee b/src/config/Config.coffee index 1fc6dddf3..320eebbb3 100644 --- a/src/config/Config.coffee +++ b/src/config/Config.coffee @@ -1009,6 +1009,10 @@ Config = 'x' 'Hide thread.' ] + 'Quick Filter MD5': [ + '5' + 'Add the MD5 of the selected image to the filter list.' + ] 'Previous Post Quoting You': [ 'Alt+Up' 'Scroll to the previous post that quotes you.'