buzzfeed is no more

This commit is contained in:
James Campos 2010-09-03 12:22:10 -07:00
parent e257da61c9
commit f43fe1fe8e
2 changed files with 67 additions and 63 deletions

View File

@ -485,8 +485,6 @@ quickReply = (e) ->
#hack - nuke the original recaptcha's id so it doesn't grab focus #hack - nuke the original recaptcha's id so it doesn't grab focus
# when reloading # when reloading
$('input[name=recaptcha_response_field]', form).id = '' $('input[name=recaptcha_response_field]', form).id = ''
#remove buzzfeed
if bf = $('.bf', clone) then remove(bf)
#remove recaptcha scripts #remove recaptcha scripts
for script in $$ 'script', clone for script in $$ 'script', clone
remove script remove script
@ -699,6 +697,10 @@ a.addEventListener('click', options, true)
inBefore(text, document.createTextNode(' / ')) inBefore(text, document.createTextNode(' / '))
inBefore(text, a) inBefore(text, a)
#hack to tab from comment straight to recaptcha
for el in $$ '#recaptcha_table a'
el.tabIndex = 1
if getValue('Reply Hiding') if getValue('Reply Hiding')
callbacks.push((root) -> callbacks.push((root) ->
tds = $$('td.doubledash', root) tds = $$('td.doubledash', root)

View File

@ -1,5 +1,5 @@
(function() { (function() {
var $, $$, BOARD, DAY, PAGENUM, REPLY, _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, a, arr, as, autoWatch, b, board, callback, callbacks, clearHidden, close, config, cutoff, delform, down, el, expandComment, expandThread, favEmpty, favNormal, favicon, getTime, getValue, head, hiddenReplies, hiddenThreads, hide, hideReply, hideThread, html, i, i1, id, iframe, iframeLoad, iframeLoop, img, inAfter, inBefore, input, inputs, l, l1, lastChecked, magic, minimize, mousedown, mousemove, mouseup, move, n, navtopr, nodeInserted, nop, now, omitted, onloadComment, onloadThread, options, optionsSave, parseResponse, position, quickReply, r, remove, replace, replyNav, report, show, showReply, showThread, slice, span, stopPropagation, submit, tag, text, thread, threadF, threads, up, watch, watchX, watched, watcher, watcherUpdate, x, xhrs; var $, $$, BOARD, DAY, PAGENUM, REPLY, _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, a, arr, as, autoWatch, b, board, callback, callbacks, clearHidden, close, config, cutoff, delform, down, el, expandComment, expandThread, favEmpty, favNormal, favicon, getTime, getValue, head, hiddenReplies, hiddenThreads, hide, hideReply, hideThread, html, i, i1, id, iframe, iframeLoad, iframeLoop, img, inAfter, inBefore, input, inputs, l, l1, lastChecked, magic, minimize, mousedown, mousemove, mouseup, move, n, navtopr, nodeInserted, nop, now, omitted, onloadComment, onloadThread, options, optionsSave, parseResponse, position, quickReply, r, remove, replace, replyNav, report, show, showReply, showThread, slice, span, stopPropagation, submit, tag, text, thread, threadF, threads, up, watch, watchX, watched, watcher, watcherUpdate, x, xhrs;
var __hasProp = Object.prototype.hasOwnProperty; var __hasProp = Object.prototype.hasOwnProperty;
config = { config = {
'Thread Hiding': true, 'Thread Hiding': true,
@ -488,7 +488,7 @@
return form.style.visibility ? (form.style.visibility = '') : (form.style.visibility = 'collapse'); return form.style.visibility ? (form.style.visibility = '') : (form.style.visibility = 'collapse');
}; };
quickReply = function(e) { quickReply = function(e) {
var _c, _d, _e, _f, bf, clone, closeB, div, form, input, minimizeB, qr, script, selection, text, textarea, xpath; var _c, _d, _e, _f, clone, closeB, div, form, input, minimizeB, qr, script, selection, text, textarea, xpath;
e.preventDefault(); e.preventDefault();
if (!(qr = $('#qr'))) { if (!(qr = $('#qr'))) {
qr = tag('div'); qr = tag('div');
@ -518,9 +518,6 @@
form = $('form[name=post]'); form = $('form[name=post]');
clone = form.cloneNode(true); clone = form.cloneNode(true);
$('input[name=recaptcha_response_field]', form).id = ''; $('input[name=recaptcha_response_field]', form).id = '';
if (bf = $('.bf', clone)) {
remove(bf);
}
_d = $$('script', clone); _d = $$('script', clone);
for (_c = 0, _e = _d.length; _c < _e; _c++) { for (_c = 0, _e = _d.length; _c < _e; _c++) {
script = _d[_c]; script = _d[_c];
@ -764,14 +761,19 @@
a.addEventListener('click', options, true); a.addEventListener('click', options, true);
inBefore(text, document.createTextNode(' / ')); inBefore(text, document.createTextNode(' / '));
inBefore(text, a); inBefore(text, a);
_d = $$('#recaptcha_table a');
for (_c = 0, _e = _d.length; _c < _e; _c++) {
el = _d[_c];
el.tabIndex = 1;
}
if (getValue('Reply Hiding')) { if (getValue('Reply Hiding')) {
callbacks.push(function(root) { callbacks.push(function(root) {
var _c, _d, _e, _f, _g, _h, _i, _j, next, obj, td, tds; var _f, _g, _h, _i, _j, _k, _l, _m, next, obj, td, tds;
tds = $$('td.doubledash', root); tds = $$('td.doubledash', root);
_c = []; _e = tds; _f = []; _h = tds;
for (_d = 0, _f = _e.length; _d < _f; _d++) { for (_g = 0, _i = _h.length; _g < _i; _g++) {
td = _e[_d]; td = _h[_g];
_c.push((function() { _f.push((function() {
a = tag('a'); a = tag('a');
a.textContent = '[ - ]'; a.textContent = '[ - ]';
a.className = 'pointer'; a.className = 'pointer';
@ -779,15 +781,15 @@
replace(td.firstChild, a); replace(td.firstChild, a);
next = td.nextSibling; next = td.nextSibling;
id = next.id; id = next.id;
_g = []; _i = hiddenReplies; _j = []; _l = hiddenReplies;
for (_h = 0, _j = _i.length; _h < _j; _h++) { for (_k = 0, _m = _l.length; _k < _m; _k++) {
obj = _i[_h]; obj = _l[_k];
_g.push(obj.id === id ? hideReply(next) : null); _j.push(obj.id === id ? hideReply(next) : null);
} }
return _g; return _j;
})()); })());
} }
return _c; return _f;
}); });
} }
if (getValue('Quick Reply')) { if (getValue('Quick Reply')) {
@ -797,24 +799,24 @@
iframe.addEventListener('load', iframeLoad, true); iframe.addEventListener('load', iframeLoad, true);
document.body.appendChild(iframe); document.body.appendChild(iframe);
callbacks.push(function(root) { callbacks.push(function(root) {
var _c, _d, _e, _f, quote, quotes; var _f, _g, _h, _i, quote, quotes;
quotes = $$('a.quotejs:not(:first-child)', root); quotes = $$('a.quotejs:not(:first-child)', root);
_c = []; _e = quotes; _f = []; _h = quotes;
for (_d = 0, _f = _e.length; _d < _f; _d++) { for (_g = 0, _i = _h.length; _g < _i; _g++) {
quote = _e[_d]; quote = _h[_g];
_c.push(quote.addEventListener('click', quickReply, true)); _f.push(quote.addEventListener('click', quickReply, true));
} }
return _c; return _f;
}); });
} }
if (getValue('Quick Report')) { if (getValue('Quick Report')) {
callbacks.push(function(root) { callbacks.push(function(root) {
var _c, _d, _e, _f, arr, el; var _f, _g, _h, _i, arr;
arr = $$('span[id^=no]', root); arr = $$('span[id^=no]', root);
_c = []; _e = arr; _f = []; _h = arr;
for (_d = 0, _f = _e.length; _d < _f; _d++) { for (_g = 0, _i = _h.length; _g < _i; _g++) {
el = _e[_d]; el = _h[_g];
_c.push((function() { _f.push((function() {
a = tag('a'); a = tag('a');
a.textContent = '[ ! ]'; a.textContent = '[ ! ]';
a.className = 'pointer'; a.className = 'pointer';
@ -823,7 +825,7 @@
return inAfter(el, document.createTextNode(' ')); return inAfter(el, document.createTextNode(' '));
})()); })());
} }
return _c; return _f;
}); });
} }
if (getValue('Thread Watcher')) { if (getValue('Thread Watcher')) {
@ -837,14 +839,14 @@
watcherUpdate(); watcherUpdate();
threads = watched[BOARD] || []; threads = watched[BOARD] || [];
inputs = $$('form > input[value="delete"], div > input[value="delete"]'); inputs = $$('form > input[value="delete"], div > input[value="delete"]');
_d = inputs; _g = inputs;
for (_c = 0, _e = _d.length; _c < _e; _c++) { for (_f = 0, _h = _g.length; _f < _h; _f++) {
input = _d[_c]; input = _g[_f];
img = tag('img'); img = tag('img');
id = input.name; id = input.name;
_g = threads; _j = threads;
for (_f = 0, _h = _g.length; _f < _h; _f++) { for (_i = 0, _k = _j.length; _i < _k; _i++) {
thread = _g[_f]; thread = _j[_i];
if (id === thread.id) { if (id === thread.id) {
img.src = favNormal; img.src = favNormal;
break; break;
@ -858,30 +860,30 @@
} }
if (getValue('Anonymize')) { if (getValue('Anonymize')) {
callbacks.push(function(root) { callbacks.push(function(root) {
var _i, _j, _k, _l, _m, _n, _o, name, names, trip, trips; var _l, _m, _n, _o, _p, _q, _r, name, names, trip, trips;
names = $$('span.postername, span.commentpostername', root); names = $$('span.postername, span.commentpostername', root);
_j = names; _m = names;
for (_i = 0, _k = _j.length; _i < _k; _i++) { for (_l = 0, _n = _m.length; _l < _n; _l++) {
name = _j[_i]; name = _m[_l];
name.innerHTML = 'Anonymous'; name.innerHTML = 'Anonymous';
} }
trips = $$('span.postertrip', root); trips = $$('span.postertrip', root);
_l = []; _n = trips; _o = []; _q = trips;
for (_m = 0, _o = _n.length; _m < _o; _m++) { for (_p = 0, _r = _q.length; _p < _r; _p++) {
trip = _n[_m]; trip = _q[_p];
_l.push(trip.parentNode.nodeName === 'A' ? remove(trip.parentNode) : remove(trip)); _o.push(trip.parentNode.nodeName === 'A' ? remove(trip.parentNode) : remove(trip));
} }
return _l; return _o;
}); });
} }
if (getValue('Reply Navigation')) { if (getValue('Reply Navigation')) {
callbacks.push(function(root) { callbacks.push(function(root) {
var _i, _j, _k, _l, arr, down, el, span, up; var _l, _m, _n, _o, arr, down, span, up;
arr = $$('span[id^=norep]', root); arr = $$('span[id^=norep]', root);
_i = []; _k = arr; _l = []; _n = arr;
for (_j = 0, _l = _k.length; _j < _l; _j++) { for (_m = 0, _o = _n.length; _m < _o; _m++) {
el = _k[_j]; el = _n[_m];
_i.push((function() { _l.push((function() {
span = tag('span'); span = tag('span');
up = tag('a'); up = tag('a');
up.textContent = '▲'; up.textContent = '▲';
@ -898,7 +900,7 @@
return inAfter(el, span); return inAfter(el, span);
})()); })());
} }
return _i; return _l;
}); });
} }
if (!REPLY) { if (!REPLY) {
@ -916,9 +918,9 @@
i = 0; i = 0;
l = arr.length; l = arr.length;
l1 = l + 1; l1 = l + 1;
_j = arr; _m = arr;
for (_i = 0, _k = _j.length; _i < _k; _i++) { for (_l = 0, _n = _m.length; _l < _n; _l++) {
el = _j[_i]; el = _m[_l];
up = tag('a'); up = tag('a');
up.className = 'pointer'; up.className = 'pointer';
if (i !== 0) { if (i !== 0) {
@ -955,9 +957,9 @@
} }
if (getValue('Thread Expansion')) { if (getValue('Thread Expansion')) {
omitted = $$('span.omittedposts'); omitted = $$('span.omittedposts');
_m = omitted; _p = omitted;
for (_l = 0, _n = _m.length; _l < _n; _l++) { for (_o = 0, _q = _p.length; _o < _q; _o++) {
span = _m[_l]; span = _p[_o];
a = tag('a'); a = tag('a');
a.className = 'pointer omittedposts'; a.className = 'pointer omittedposts';
a.textContent = ("+ " + (span.textContent)); a.textContent = ("+ " + (span.textContent));
@ -967,16 +969,16 @@
} }
if (getValue('Comment Expansion')) { if (getValue('Comment Expansion')) {
as = $$('span.abbr a'); as = $$('span.abbr a');
_p = as; _s = as;
for (_o = 0, _q = _p.length; _o < _q; _o++) { for (_r = 0, _t = _s.length; _r < _t; _r++) {
a = _p[_o]; a = _s[_r];
a.addEventListener('click', expandComment, true); a.addEventListener('click', expandComment, true);
} }
} }
} }
_s = callbacks; _v = callbacks;
for (_r = 0, _t = _s.length; _r < _t; _r++) { for (_u = 0, _w = _v.length; _u < _w; _u++) {
callback = _s[_r]; callback = _v[_u];
callback(); callback();
} }
document.body.addEventListener('DOMNodeInserted', nodeInserted, true); document.body.addEventListener('DOMNodeInserted', nodeInserted, true);