Add search by flag to archive link menu.
This commit is contained in:
parent
aac114d2ab
commit
ffe6e51a1d
@ -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',
|
||||
|
||||
@ -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)
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user