From 2132896d544ae1aeebf0d04184745851769c9bce Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Thu, 12 May 2011 13:10:25 +0200 Subject: [PATCH 1/2] Fix anonymizer not cleaning the name. --- 4chan_x.js | 9 ++++++--- script.coffee | 4 ++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/4chan_x.js b/4chan_x.js index 4ee5be823..f42b645bc 100644 --- a/4chan_x.js +++ b/4chan_x.js @@ -1582,9 +1582,12 @@ }, cb: { node: function(root) { - var name, trip; - name = $$('span.postername, span.commentpostername', root); - name.innerHTML = 'Anonymous'; + var name, trip, _i, _len, _ref; + _ref = $$('span.postername, span.commentpostername', root); + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + name = _ref[_i]; + name.textContent = 'Anonymous'; + } if (trip = $('span.postertrip', root)) { if (trip.parentNode.nodeName === 'A') { return $.remove(trip.parentNode); diff --git a/script.coffee b/script.coffee index dfce779d0..3583221bb 100644 --- a/script.coffee +++ b/script.coffee @@ -1290,8 +1290,8 @@ anonymize = g.callbacks.push anonymize.cb.node cb: node: (root) -> - name = $$ 'span.postername, span.commentpostername', root - name.innerHTML = 'Anonymous' + for name in $$ 'span.postername, span.commentpostername', root + name.textContent = 'Anonymous' if trip = $ 'span.postertrip', root if trip.parentNode.nodeName is 'A' $.remove trip.parentNode From 8d4eff231b7df1fa56260ea57a4c1c471d68095d Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Thu, 12 May 2011 13:17:00 +0200 Subject: [PATCH 2/2] Uh oh, so that's simpler and actually possible. --- 4chan_x.js | 9 +++------ script.coffee | 4 ++-- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/4chan_x.js b/4chan_x.js index f42b645bc..8c24509ef 100644 --- a/4chan_x.js +++ b/4chan_x.js @@ -1582,12 +1582,9 @@ }, cb: { node: function(root) { - var name, trip, _i, _len, _ref; - _ref = $$('span.postername, span.commentpostername', root); - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - name = _ref[_i]; - name.textContent = 'Anonymous'; - } + var name, trip; + name = $('span.commentpostername, span.postername', root); + name.textContent = 'Anonymous'; if (trip = $('span.postertrip', root)) { if (trip.parentNode.nodeName === 'A') { return $.remove(trip.parentNode); diff --git a/script.coffee b/script.coffee index 3583221bb..cf648af04 100644 --- a/script.coffee +++ b/script.coffee @@ -1290,8 +1290,8 @@ anonymize = g.callbacks.push anonymize.cb.node cb: node: (root) -> - for name in $$ 'span.postername, span.commentpostername', root - name.textContent = 'Anonymous' + name = $ 'span.commentpostername, span.postername', root + name.textContent = 'Anonymous' if trip = $ 'span.postertrip', root if trip.parentNode.nodeName is 'A' $.remove trip.parentNode