diff --git a/4chan_x.user.js b/4chan_x.user.js index 6919ada61..b0262358e 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -61,7 +61,7 @@ */ (function() { - var $, $$, DAY, Favicon, HOUR, MINUTE, Main, NAMESPACE, QR, SECOND, Time, anonymize, conf, config, d, expandComment, expandThread, filter, firstRun, flatten, g, getTitle, imgExpand, imgGif, imgHover, imgPreloading, key, keybinds, log, nav, options, quoteBacklink, quoteInline, quoteOP, quotePreview, redirect, replyHiding, reportButton, revealSpoilers, sauce, threadHiding, threadStats, threading, titlePost, ui, unread, updater, val, watcher; + var $, $$, DAY, Favicon, HOUR, MINUTE, Main, NAMESPACE, QR, SECOND, Time, anonymize, conf, config, d, expandComment, expandThread, filter, firstRun, flatten, g, getTitle, imgExpand, imgGif, imgHover, imgPreloading, key, keybinds, log, nav, options, quoteBacklink, quoteInline, quoteOP, quotePreview, redirect, replyHiding, reportButton, revealSpoilers, sauce, strikethroughQuotes, threadHiding, threadStats, threading, titlePost, ui, unread, updater, val, watcher; var __slice = Array.prototype.slice; config = { main: { @@ -586,6 +586,23 @@ } } }; + strikethroughQuotes = { + init: function() { + return g.callbacks.push(function(root) { + var el, quote, _i, _len, _ref, _results; + if (root.className === 'inline') { + return; + } + _ref = $$('.quotelink', root); + _results = []; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + quote = _ref[_i]; + _results.push((el = $.id(quote.hash.slice(1))) ? el.parentNode.parentNode.parentNode.hidden ? $.addClass(quote, 'filtered') : void 0 : void 0); + } + return _results; + }); + } + }; expandComment = { init: function() { var a, _i, _len, _ref, _results; @@ -3036,6 +3053,9 @@ if (conf['Reply Hiding']) { replyHiding.init(); } + if (conf['Filter'] || conf['Reply Hiding']) { + strikethroughQuotes.init(); + } if (conf['Anonymize']) { anonymize.init(); } diff --git a/script.coffee b/script.coffee index fca90fd97..d993c328d 100644 --- a/script.coffee +++ b/script.coffee @@ -425,6 +425,15 @@ filter = if img = $ 'img[md5]', root filter.test 'md5', img.getAttribute('md5') +strikethroughQuotes = + init: -> + g.callbacks.push (root) -> + return if root.className is 'inline' + for quote in $$ '.quotelink', root + if el = $.id quote.hash[1..] + if el.parentNode.parentNode.parentNode.hidden + $.addClass quote, 'filtered' + expandComment = init: -> for a in $$ '.abbr a' @@ -2308,6 +2317,9 @@ Main = if conf['Reply Hiding'] replyHiding.init() + if conf['Filter'] or conf['Reply Hiding'] + strikethroughQuotes.init() + if conf['Anonymize'] anonymize.init()