From 7ec83c24bcbe4888b8cc86db6b973fd1d964f71e Mon Sep 17 00:00:00 2001 From: Mayhem Date: Thu, 13 Feb 2014 18:30:55 +0100 Subject: [PATCH] Add a tooltip showing the OP's post info in the catalog. --- css/style.css | 10 ++++++++++ src/General/Index.coffee | 24 ++++++++++++++++++++++++ src/General/UI.coffee | 19 +++++++++++-------- 3 files changed, 45 insertions(+), 8 deletions(-) diff --git a/css/style.css b/css/style.css index 11916e177..83e1e8d08 100644 --- a/css/style.css +++ b/css/style.css @@ -495,6 +495,16 @@ a[href="javascript:;"] { overflow: hidden; text-align: center; } +.thread-info { + position: fixed; + background: inherit; + padding: 2px; + border-radius: 2px; + box-shadow: 0 0 5px rgba(0, 0, 0, .25); +} +.thread-info .post { + margin: 0; +} /* Announcement Hiding */ :root.hide-announcement #globalMessage, diff --git a/src/General/Index.coffee b/src/General/Index.coffee index 87662808e..837c360ea 100644 --- a/src/General/Index.coffee +++ b/src/General/Index.coffee @@ -159,6 +159,8 @@ Index = @pin() if data.isPinned catalogNode: -> $.on @nodes.thumb, 'click', Index.onClick + return if Conf['Image Hover in Catalog'] + $.on @nodes.thumb, 'mouseover', Index.onOver onClick: (e) -> return if e.button isnt 0 thread = g.threads[@parentNode.dataset.fullID] @@ -169,6 +171,28 @@ Index = else return e.preventDefault() + onOver: (e) -> + # 4chan's less than stellar CSS forces us to include a .post and .postInfo + # in order to have proper styling for the .nameBlock's content. + {nodes} = g.threads[@parentNode.dataset.fullID].OP + el = $.el 'div', + innerHTML: '