Move site type specific linkification tests to appropriate place.

This commit is contained in:
ccd0 2019-07-10 18:19:09 -07:00
parent 6387eb4ad1
commit f9dc328286
3 changed files with 7 additions and 1 deletions

View File

@ -14,7 +14,7 @@ Linkify =
node: ->
return Embedding.events @ if @isClone
return unless Linkify.regString.test @info.comment
for link in $$ 'a', @nodes.comment when ImageHost.test(link.hostname) or /\bnofollow\b/.test(link.rel)
for link in $$ 'a', @nodes.comment when g.SITE.isLinkified?(link)
$.addClass link, 'linkify'
ImageHost.fixLinks [link] if ImageHost.useFaster
Embedding.process link, @

View File

@ -166,3 +166,6 @@ SW.tinyboard =
isThumbExpanded: (file) ->
# Detect old Tinyboard image expansion that changes src attribute on thumbnail.
$.hasClass file.thumb.parentNode, 'expanded'
isLinkified: (link) ->
/\bnofollow\b/.test(link.rel)

View File

@ -168,3 +168,6 @@ SW.yotsuba =
while i < 8
msg = (msg << 5) - msg + uid.charCodeAt i++
(msg >> 8) & 0xFFFFFF
isLinkified: (link) ->
ImageHost.test(link.hostname)