From 18c9642b5269444192b7ea151e39eb1341cc4c5d Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Mon, 30 Apr 2012 10:28:44 +0200 Subject: [PATCH] Fix filter highlight styling. --- 4chan_x.user.js | 12 ++++-------- script.coffee | 11 ++++------- 2 files changed, 8 insertions(+), 15 deletions(-) diff --git a/4chan_x.user.js b/4chan_x.user.js index a5b3cec7f..5b9b1e16c 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -621,7 +621,7 @@ if (post.isInlined) { return; } - isOP = post["class"] === 'op'; + isOP = /\bop\b/.test(post["class"]); el = post.el; for (key in Filter.filters) { value = Filter[key](post); @@ -646,11 +646,7 @@ } return; } - if (isOP) { - $.addClass(el.parentNode, result[0]); - } else { - $.addClass(el, result[0]); - } + $.addClass((isOP ? post.root.parentNode : post.root), result[0]); if (isOP && result[1] && !g.REPLY) { thisThread = el.parentNode.parentNode; if (firstThread = $('div[class="postContainer opContainer"]')) { @@ -4574,8 +4570,8 @@ input ~ a > img[data-md5] {\ .filetitle, .replytitle, .postername, .commentpostername, .postertrip {\ background: none;\ }\ -.filter_highlight.op,\ -.filter_highlight > td[id] {\ +.filter_highlight.thread,\ +.filter_highlight > .reply {\ box-shadow: -5px 0 rgba(255,0,0,0.5);\ }\ .filtered {\ diff --git a/script.coffee b/script.coffee index e28bbb90e..57dc06936 100644 --- a/script.coffee +++ b/script.coffee @@ -513,7 +513,7 @@ Filter = node: (post) -> return if post.isInlined - isOP = post.class is 'op' + isOP = /\bop\b/.test post.class {el} = post for key of Filter.filters value = Filter[key] post @@ -536,10 +536,7 @@ Filter = return # Highlight - if isOP - $.addClass el.parentNode, result[0] - else - $.addClass el, result[0] + $.addClass (if isOP then post.root.parentNode else post.root), result[0] if isOP and result[1] and not g.REPLY # Put the highlighted OPs' threads on top of the board pages... thisThread = el.parentNode.parentNode @@ -3595,8 +3592,8 @@ input ~ a > img[data-md5] { .filetitle, .replytitle, .postername, .commentpostername, .postertrip { background: none; } -.filter_highlight.op, -.filter_highlight > td[id] { +.filter_highlight.thread, +.filter_highlight > .reply { box-shadow: -5px 0 rgba(255,0,0,0.5); } .filtered {