Strikethrough quotelinks of filtered posts.

This commit is contained in:
Nicolas Stepien 2011-10-30 18:48:22 +01:00
parent b5bb703288
commit fa83f24a09
2 changed files with 33 additions and 1 deletions

View File

@ -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();
}

View File

@ -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()