Add search by flag to archive link menu.

This commit is contained in:
ccd0 2016-05-18 02:05:53 -07:00
parent aac114d2ab
commit ffe6e51a1d
2 changed files with 6 additions and 1 deletions

View File

@ -18,6 +18,7 @@ ArchiveLink =
['Tripcode', 'tripcode']
['Capcode', 'capcode']
['Subject', 'subject']
['Flag', 'country']
['Filename', 'filename']
['Image MD5', 'MD5']
]
@ -37,7 +38,10 @@ ArchiveLink =
true
else
(post) ->
value = Filter[type] post
value = if type is 'country'
post.info.flagCode
else
Filter[type] post
# We want to parse the exact same stuff as the filter does already.
return false unless value
el.href = Redirect.to 'search',

View File

@ -28,6 +28,7 @@ class Post
tripcode: @nodes.tripcode?.textContent
uniqueID: @nodes.uniqueID?.firstElementChild.textContent
capcode: @nodes.capcode?.textContent.replace '## ', ''
flagCode: @nodes.flag?.className.match(/flag-(\w+)/)?[1].toUpperCase()
flag: @nodes.flag?.title
date: if @nodes.date then new Date(@nodes.date.dataset.utc * 1000)