Image Hover in Catalog

This commit is contained in:
ccd0 2014-09-27 00:47:14 -07:00
parent a0e1268e60
commit a94dd0c71f
2 changed files with 18 additions and 6 deletions

View File

@ -159,6 +159,10 @@ Config =
true
'Show full image / video on mouseover.'
]
'Image Hover in Catalog': [
false
'Show full image / video on mouseover in 4chan X catalog.'
]
'Gallery': [
true
'Adds a simple and cute image gallery.'

View File

@ -1,13 +1,21 @@
ImageHover =
init: ->
return if g.VIEW is 'catalog' or !Conf['Image Hover']
Post.callbacks.push
name: 'Image Hover'
cb: @node
return if g.VIEW is 'catalog'
if Conf['Image Hover']
Post.callbacks.push
name: 'Image Hover'
cb: @node
if Conf['Image Hover in Catalog']
CatalogThread.callbacks.push
name: 'Catalog Image Hover'
cb: @catalogNode
node: ->
return unless @file?.isImage or @file?.isVideo
return unless @file and (@file.isImage or @file.isVideo)
$.on @file.thumb, 'mouseover', ImageHover.mouseover @
catalogNode: ->
{file} = @thread.OP
return unless file and (file.isImage or file.isVideo)
$.on @nodes.thumb, 'mouseover', ImageHover.mouseover @thread.OP
mouseover: (post) -> (e) ->
return unless doc.contains @
{file} = post