Add keybind for filtering image MD5s (default: "5").

This commit is contained in:
ccd0 2016-11-07 21:52:48 -08:00
parent 76f8118872
commit dc29011c10
3 changed files with 16 additions and 3 deletions

View File

@ -171,6 +171,7 @@ Filter =
quickFilterMD5: -> quickFilterMD5: ->
post = Get.postFromNode @ post = Get.postFromNode @
return unless post.file
Filter.addFilter 'MD5', "/#{post.file.MD5}/" Filter.addFilter 'MD5', "/#{post.file.MD5}/"
origin = post.origin or post origin = post.origin or post
if origin.isReply if origin.isReply

View File

@ -199,6 +199,11 @@ Keybinds =
return unless thread and ThreadHiding.db return unless thread and ThreadHiding.db
Header.scrollTo threadRoot Header.scrollTo threadRoot
ThreadHiding.toggle thread 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'] when Conf['Previous Post Quoting You']
return unless threadRoot and QuoteYou.db return unless threadRoot and QuoteYou.db
QuoteYou.cb.seek 'preceding' QuoteYou.cb.seek 'preceding'
@ -255,10 +260,13 @@ Keybinds =
if e.shiftKey then key = 'Shift+' + key if e.shiftKey then key = 'Shift+' + key
key key
post: (thread) ->
$('.post.highlight', thread) or $('.op', thread)
qr: (thread) -> qr: (thread) ->
QR.open() QR.open()
if thread? if thread?
QR.quote.call $ 'input', $('.post.highlight', thread) or thread QR.quote.call Keybinds.post thread
QR.nodes.com.focus() QR.nodes.com.focus()
tags: (tag, ta) -> tags: (tag, ta) ->
@ -297,8 +305,8 @@ Keybinds =
if all if all
ImageExpand.cb.toggleAll() ImageExpand.cb.toggleAll()
else else
post = Get.postFromNode $('.post.highlight', thread) or $ '.op', thread post = Get.postFromNode Keybinds.post thread
ImageExpand.toggle post ImageExpand.toggle post if post.file
open: (thread, tab) -> open: (thread, tab) ->
return if g.VIEW isnt 'index' return if g.VIEW isnt 'index'

View File

@ -1009,6 +1009,10 @@ Config =
'x' 'x'
'Hide thread.' 'Hide thread.'
] ]
'Quick Filter MD5': [
'5'
'Add the MD5 of the selected image to the filter list.'
]
'Previous Post Quoting You': [ 'Previous Post Quoting You': [
'Alt+Up' 'Alt+Up'
'Scroll to the previous post that quotes you.' 'Scroll to the previous post that quotes you.'