anonymize
This commit is contained in:
parent
b78c23684a
commit
26fc2fd2a2
44
4chan_x.js
44
4chan_x.js
@ -59,7 +59,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
var $, $$, NAMESPACE, autoWatch, callback, config, d, delform, el, expand, expandComment, expandThread, g, imageClick, imageExpand, imageExpandClick, imageHover, imageResize, imageThumb, imageToggle, imageType, imageTypeChange, keybinds, log, nav, navtopr, nodeInserted, option, options, pathname, qr, quickReport, recaptcha, recaptchaListener, recaptchaReload, redirect, replyHiding, scroll, temp, text, threadHiding, tzOffset, ui, updateFavicon, updateTitle, updater, watcher, _config, _i, _j, _k, _len, _len2, _len3, _ref, _ref2, _ref3, _ref4;
|
var $, $$, NAMESPACE, anonymize, autoWatch, callback, config, d, delform, el, expand, expandComment, expandThread, g, imageClick, imageExpand, imageExpandClick, imageHover, imageResize, imageThumb, imageToggle, imageType, imageTypeChange, keybinds, log, nav, navtopr, nodeInserted, option, options, pathname, qr, quickReport, recaptcha, recaptchaListener, recaptchaReload, redirect, replyHiding, scroll, temp, text, threadHiding, tzOffset, ui, updateFavicon, updateTitle, updater, watcher, _config, _i, _j, _k, _len, _len2, _len3, _ref, _ref2, _ref3, _ref4;
|
||||||
var __slice = Array.prototype.slice;
|
var __slice = Array.prototype.slice;
|
||||||
if (typeof console != "undefined" && console !== null) {
|
if (typeof console != "undefined" && console !== null) {
|
||||||
log = console.log;
|
log = console.log;
|
||||||
@ -1560,6 +1560,28 @@
|
|||||||
return watcher.addLink(props);
|
return watcher.addLink(props);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
anonymize = {
|
||||||
|
init: function() {
|
||||||
|
return g.callbacks.push(anonymize.cb.node);
|
||||||
|
},
|
||||||
|
cb: {
|
||||||
|
node: function(root) {
|
||||||
|
var name, names, trip, _i, _j, _len, _len2, _ref, _results;
|
||||||
|
names = $$('span.postername, span.commentpostername', root);
|
||||||
|
for (_i = 0, _len = names.length; _i < _len; _i++) {
|
||||||
|
name = names[_i];
|
||||||
|
name.innerHTML = 'Anonymous';
|
||||||
|
}
|
||||||
|
_ref = $$('span.postertrip', root);
|
||||||
|
_results = [];
|
||||||
|
for (_j = 0, _len2 = _ref.length; _j < _len2; _j++) {
|
||||||
|
trip = _ref[_j];
|
||||||
|
_results.push(trip.parentNode.nodeName === 'A' ? $.remove(trip.parentNode) : $.remove(trip));
|
||||||
|
}
|
||||||
|
return _results;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
imageClick = function(e) {
|
imageClick = function(e) {
|
||||||
if (e.shiftKey || e.altKey || e.ctrlKey) {
|
if (e.shiftKey || e.altKey || e.ctrlKey) {
|
||||||
return;
|
return;
|
||||||
@ -1968,23 +1990,6 @@
|
|||||||
recaptcha = $('#recaptcha_response_field');
|
recaptcha = $('#recaptcha_response_field');
|
||||||
$.bind(recaptcha, 'keydown', recaptchaListener);
|
$.bind(recaptcha, 'keydown', recaptchaListener);
|
||||||
$.bind($('form[name=post]'), 'submit', qr.cb.submit);
|
$.bind($('form[name=post]'), 'submit', qr.cb.submit);
|
||||||
if ($.config('Anonymize')) {
|
|
||||||
g.callbacks.push(function(root) {
|
|
||||||
var name, names, trip, trips, _i, _j, _len, _len2, _results;
|
|
||||||
names = $$('span.postername, span.commentpostername', root);
|
|
||||||
for (_i = 0, _len = names.length; _i < _len; _i++) {
|
|
||||||
name = names[_i];
|
|
||||||
name.innerHTML = 'Anonymous';
|
|
||||||
}
|
|
||||||
trips = $$('span.postertrip', root);
|
|
||||||
_results = [];
|
|
||||||
for (_j = 0, _len2 = trips.length; _j < _len2; _j++) {
|
|
||||||
trip = trips[_j];
|
|
||||||
_results.push(trip.parentNode.nodeName === 'A' ? $.remove(trip.parentNode) : $.remove(trip));
|
|
||||||
}
|
|
||||||
return _results;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
if ($.config('Image Expansion')) {
|
if ($.config('Image Expansion')) {
|
||||||
delform = $('form[name=delform]');
|
delform = $('form[name=delform]');
|
||||||
expand = $.el('div', {
|
expand = $.el('div', {
|
||||||
@ -2088,6 +2093,9 @@
|
|||||||
return _results;
|
return _results;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
if ($.config('Anonymize')) {
|
||||||
|
anonymize.init();
|
||||||
|
}
|
||||||
if ($.config('Image Hover')) {
|
if ($.config('Image Hover')) {
|
||||||
imageHover.init();
|
imageHover.init();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1235,6 +1235,19 @@ watcher =
|
|||||||
|
|
||||||
watcher.addLink props
|
watcher.addLink props
|
||||||
|
|
||||||
|
anonymize =
|
||||||
|
init: ->
|
||||||
|
g.callbacks.push anonymize.cb.node
|
||||||
|
cb:
|
||||||
|
node: (root) ->
|
||||||
|
names = $$ 'span.postername, span.commentpostername', root
|
||||||
|
for name in names
|
||||||
|
name.innerHTML = 'Anonymous'
|
||||||
|
for trip in $$ 'span.postertrip', root
|
||||||
|
if trip.parentNode.nodeName is 'A'
|
||||||
|
$.remove trip.parentNode
|
||||||
|
else
|
||||||
|
$.remove trip
|
||||||
|
|
||||||
# TODO rewrite these **************************************************************************
|
# TODO rewrite these **************************************************************************
|
||||||
|
|
||||||
@ -1569,18 +1582,6 @@ $.bind recaptcha, 'keydown', recaptchaListener
|
|||||||
$.bind $('form[name=post]'), 'submit', qr.cb.submit
|
$.bind $('form[name=post]'), 'submit', qr.cb.submit
|
||||||
|
|
||||||
#major features
|
#major features
|
||||||
if $.config 'Anonymize'
|
|
||||||
g.callbacks.push (root) ->
|
|
||||||
names = $$('span.postername, span.commentpostername', root)
|
|
||||||
for name in names
|
|
||||||
name.innerHTML = 'Anonymous'
|
|
||||||
trips = $$('span.postertrip', root)
|
|
||||||
for trip in trips
|
|
||||||
if trip.parentNode.nodeName is 'A'
|
|
||||||
$.remove trip.parentNode
|
|
||||||
else
|
|
||||||
$.remove trip
|
|
||||||
|
|
||||||
if $.config 'Image Expansion'
|
if $.config 'Image Expansion'
|
||||||
delform = $ 'form[name=delform]'
|
delform = $ 'form[name=delform]'
|
||||||
expand = $.el 'div',
|
expand = $.el 'div',
|
||||||
@ -1652,6 +1653,9 @@ if $.config 'Sauce'
|
|||||||
$.append span, $.tn(' '), link
|
$.append span, $.tn(' '), link
|
||||||
i++
|
i++
|
||||||
|
|
||||||
|
if $.config 'Anonymize'
|
||||||
|
anonymize.init()
|
||||||
|
|
||||||
if $.config 'Image Hover'
|
if $.config 'Image Hover'
|
||||||
imageHover.init()
|
imageHover.init()
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user