Add recursive filtering option. Close #128

This commit is contained in:
Nicolas Stepien 2012-02-06 16:07:56 +01:00
parent 3a13f86258
commit df64f4628d
3 changed files with 10 additions and 6 deletions

View File

@ -91,6 +91,7 @@
'Anonymize': [false, 'Make everybody anonymous'], 'Anonymize': [false, 'Make everybody anonymous'],
'Filter': [false, 'Self-moderation placebo'], 'Filter': [false, 'Self-moderation placebo'],
'Filter OPs': [false, 'Filter OPs along with their threads'], 'Filter OPs': [false, 'Filter OPs along with their threads'],
'Recursive Filtering': [false, 'Filter replies of filtered posts, recursively'],
'Reply Hiding': [true, 'Hide single replies'], 'Reply Hiding': [true, 'Hide single replies'],
'Thread Hiding': [true, 'Hide entire threads'], 'Thread Hiding': [true, 'Hide entire threads'],
'Show Stubs': [true, 'Of hidden threads / replies'] 'Show Stubs': [true, 'Of hidden threads / replies']
@ -617,9 +618,10 @@
_results = []; _results = [];
for (_i = 0, _len = _ref.length; _i < _len; _i++) { for (_i = 0, _len = _ref.length; _i < _len; _i++) {
quote = _ref[_i]; quote = _ref[_i];
if (el = $.id(quote.hash.slice(1))) { if ((el = $.id(quote.hash.slice(1))) && el.parentNode.parentNode.parentNode.hidden) {
if (el.parentNode.parentNode.parentNode.hidden) { $.addClass(quote, 'filtered');
_results.push($.addClass(quote, 'filtered')); if (conf['Recursive Filtering']) {
_results.push(root.hidden = true);
} else { } else {
_results.push(void 0); _results.push(void 0);
} }

View File

@ -4,6 +4,7 @@ master
- Mayhem - Mayhem
Increase Sauce linking possibilites: Increase Sauce linking possibilites:
Thumbnails, full images, MD5 hashes. Thumbnails, full images, MD5 hashes.
New option: Recursive Filtering: Filter replies of filtered posts.
Unread Favicon is now optional, independent of Unread Count. Unread Favicon is now optional, independent of Unread Count.
Fix some compatibility issues with file drag and drop, notably with QuickDrag extension. Fix some compatibility issues with file drag and drop, notably with QuickDrag extension.

View File

@ -14,6 +14,7 @@ config =
'Anonymize': [false, 'Make everybody anonymous'] 'Anonymize': [false, 'Make everybody anonymous']
'Filter': [false, 'Self-moderation placebo'] 'Filter': [false, 'Self-moderation placebo']
'Filter OPs': [false, 'Filter OPs along with their threads'] 'Filter OPs': [false, 'Filter OPs along with their threads']
'Recursive Filtering': [false, 'Filter replies of filtered posts, recursively']
'Reply Hiding': [true, 'Hide single replies'] 'Reply Hiding': [true, 'Hide single replies']
'Thread Hiding': [true, 'Hide entire threads'] 'Thread Hiding': [true, 'Hide entire threads']
'Show Stubs': [true, 'Of hidden threads / replies'] 'Show Stubs': [true, 'Of hidden threads / replies']
@ -456,9 +457,9 @@ strikethroughQuotes =
g.callbacks.push (root) -> g.callbacks.push (root) ->
return if root.className is 'inline' return if root.className is 'inline'
for quote in $$ '.quotelink', root for quote in $$ '.quotelink', root
if el = $.id quote.hash[1..] if (el = $.id quote.hash[1..]) and el.parentNode.parentNode.parentNode.hidden
if el.parentNode.parentNode.parentNode.hidden $.addClass quote, 'filtered'
$.addClass quote, 'filtered' root.hidden = true if conf['Recursive Filtering']
expandComment = expandComment =
init: -> init: ->