update to coffeescript 0.9.1 1eebbfe2bcc1a0d46a0d

need the git version for quoted object keys:
obj =
  'foo': 'bar'
  'baz': 'qux'
This commit is contained in:
James Campos 2010-08-13 22:22:43 -07:00
parent 1d247cbfdc
commit c5abc905d9
2 changed files with 537 additions and 507 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,4 @@
(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, make, minimize, mousedown, mousemove, mouseup, move, 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, 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, make, minimize, mousedown, mousemove, mouseup, move, 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 = {
@ -47,12 +47,10 @@
return document.createElement(el); return document.createElement(el);
}; };
hide = function(el) { hide = function(el) {
el.style.display = 'none'; return (el.style.display = 'none');
return el.style.display;
}; };
show = function(el) { show = function(el) {
el.style.display = ''; return (el.style.display = '');
return el.style.display;
}; };
remove = function(el) { remove = function(el) {
return el.parentNode.removeChild(el); return el.parentNode.removeChild(el);
@ -64,13 +62,15 @@
return Math.floor(new Date().getTime() / 1000); return Math.floor(new Date().getTime() / 1000);
}; };
make = function(tag, obj) { make = function(tag, obj) {
var _a, el, key; var _a, _b, el, key;
el = document.createElement(tag); el = document.createElement(tag);
if (obj) { if (obj) {
_a = obj; _b = obj;
for (key in _a) { if (__hasProp.call(_a, key)) { for (key in _b) {
if (!__hasProp.call(_b, key)) continue;
_a = _b[key];
el[key] = obj[key]; el[key] = obj[key];
}} }
} }
return el; return el;
}; };
@ -79,7 +79,7 @@
i = 0; i = 0;
l = arr.length; l = arr.length;
_a = []; _a = [];
while (i < l) { while ((i < l)) {
if (id === arr[i].id) { if (id === arr[i].id) {
arr.splice(i, 1); arr.splice(i, 1);
return arr; return arr;
@ -91,8 +91,12 @@
position = function(el) { position = function(el) {
var id, left, top; var id, left, top;
id = el.id; id = el.id;
(left = GM_getValue(("" + (id) + "Left"), '0px')) ? (el.style.left = left) : (el.style.right = '0px'); if ((left = GM_getValue("${id}Left", '0px'))) {
return (top = GM_getValue(("" + (id) + "Top"), '0px')) ? (el.style.top = top) : (el.style.bottom = '0px'); el.style.left = left;
} else {
el.style.right = '0px';
};
return (top = GM_getValue("${id}Top", '0px')) ? (el.style.top = top) : (el.style.bottom = '0px');
}; };
if (typeof GM_deleteValue === 'undefined') { if (typeof GM_deleteValue === 'undefined') {
this.GM_setValue = function(name, value) { this.GM_setValue = function(name, value) {
@ -151,7 +155,11 @@
nop = _b[0]; nop = _b[0];
BOARD = _b[1]; BOARD = _b[1];
magic = _b[2]; magic = _b[2];
magic === 'res' ? (REPLY = magic) : (PAGENUM = parseInt(magic) || 0); if (magic === 'res') {
REPLY = magic;
} else {
PAGENUM = parseInt(magic) || 0;
};
xhrs = []; xhrs = [];
r = null; r = null;
iframeLoop = false; iframeLoop = false;
@ -166,8 +174,8 @@
} }
favNormal = favicon.href; favNormal = favicon.href;
favEmpty = 'data:image/gif;base64,R0lGODlhEAAQAJEAAAAAAP///9vb2////yH5BAEAAAMALAAAAAAQABAAAAIvnI+pq+D9DBAUoFkPFnbs7lFZKIJOJJ3MyraoB14jFpOcVMpzrnF3OKlZYsMWowAAOw=='; favEmpty = 'data:image/gif;base64,R0lGODlhEAAQAJEAAAAAAP///9vb2////yH5BAEAAAMALAAAAAAQABAAAAIvnI+pq+D9DBAUoFkPFnbs7lFZKIJOJJ3MyraoB14jFpOcVMpzrnF3OKlZYsMWowAAOw==';
hiddenThreads = JSON.parse(GM_getValue(("hiddenThreads/" + BOARD + "/"), '[]')); hiddenThreads = JSON.parse(GM_getValue("hiddenThreads/$BOARD/", '[]'));
hiddenReplies = JSON.parse(GM_getValue(("hiddenReplies/" + BOARD + "/"), '[]')); hiddenReplies = JSON.parse(GM_getValue("hiddenReplies/$BOARD/", '[]'));
lastChecked = GM_getValue('lastChecked', 0); lastChecked = GM_getValue('lastChecked', 0);
now = getTime(); now = getTime();
DAY = 24 * 60 * 60; DAY = 24 * 60 * 60;
@ -185,8 +193,8 @@
} }
hiddenReplies.shift(); hiddenReplies.shift();
} }
GM_setValue(("hiddenThreads/" + BOARD + "/"), JSON.stringify(hiddenThreads)); GM_setValue("hiddenThreads/$BOARD/", JSON.stringify(hiddenThreads));
GM_setValue(("hiddenReplies/" + BOARD + "/"), JSON.stringify(hiddenReplies)); GM_setValue("hiddenReplies/$BOARD/", JSON.stringify(hiddenReplies));
GM_setValue('lastChecked', now); GM_setValue('lastChecked', now);
} }
GM_addStyle(' \ GM_addStyle(' \
@ -244,15 +252,14 @@ cursor: pointer; \
} \ } \
'); ');
clearHidden = function() { clearHidden = function() {
GM_deleteValue("hiddenReplies/" + BOARD + "/"); GM_deleteValue("hiddenReplies/$BOARD/");
GM_deleteValue("hiddenThreads/" + BOARD + "/"); GM_deleteValue("hiddenThreads/$BOARD/");
this.value = "hidden: 0"; this.value = "hidden: 0";
hiddenReplies = []; hiddenReplies = [];
hiddenThreads = []; return (hiddenThreads = []);
return hiddenThreads;
}; };
options = function() { options = function() {
var _c, checked, div, hiddenNum, option; var _c, _d, checked, div, hiddenNum, option;
if ((div = $('#options'))) { if ((div = $('#options'))) {
return remove(div); return remove(div);
} else { } else {
@ -262,12 +269,14 @@ cursor: pointer; \
div.className = 'reply'; div.className = 'reply';
position(div); position(div);
html = '<div class="move">4chan X</div><div>'; html = '<div class="move">4chan X</div><div>';
_c = config; _d = config;
for (option in _c) { if (__hasProp.call(_c, option)) { for (option in _d) {
if (!__hasProp.call(_d, option)) continue;
_c = _d[option];
checked = getValue(option) ? "checked" : ""; checked = getValue(option) ? "checked" : "";
html += ("<label>" + option + "<input " + checked + " name=\"" + option + "\" type=\"checkbox\"></label><br>"); html += "<label>$option<input $checked name=\"$option\" type=\"checkbox\"></label><br>";
}} }
html += ("<input type=\"button\" value=\"hidden: " + hiddenNum + "\"><br>"); html += "<input type=\"button\" value=\"hidden: $hiddenNum\"><br>";
html += '<a name="save">save</a> <a name="cancel">cancel</a></div>'; html += '<a name="save">save</a> <a name="cancel">cancel</a></div>';
div.innerHTML = html; div.innerHTML = html;
$('div', div).addEventListener('mousedown', mousedown, true); $('div', div).addEventListener('mousedown', mousedown, true);
@ -308,18 +317,16 @@ cursor: pointer; \
top = realY < 20 ? 0 : realY; top = realY < 20 ? 0 : realY;
if (move.bodyY - div.offsetHeight - realY < 20) { if (move.bodyY - div.offsetHeight - realY < 20) {
div.style.top = ''; div.style.top = '';
div.style.bottom = '0px'; return (div.style.bottom = '0px');
return div.style.bottom;
} else { } else {
div.style.top = top + 'px'; div.style.top = top + 'px';
div.style.bottom = ''; return (div.style.bottom = '');
return div.style.bottom;
} }
}; };
mouseup = function() { mouseup = function() {
id = move.div.id; id = move.div.id;
GM_setValue(("" + (id) + "Left"), move.div.style.left); GM_setValue("${id}Left", move.div.style.left);
GM_setValue(("" + (id) + "Top"), move.div.style.top); GM_setValue("${id}Top", move.div.style.top);
window.removeEventListener('mousemove', mousemove, true); window.removeEventListener('mousemove', mousemove, true);
return window.removeEventListener('mouseup', mouseup, true); return window.removeEventListener('mouseup', mouseup, true);
}; };
@ -330,27 +337,31 @@ cursor: pointer; \
hide(this); hide(this);
id = div.id; id = div.id;
slice(hiddenThreads, id); slice(hiddenThreads, id);
return GM_setValue(("hiddenThreads/" + BOARD + "/"), JSON.stringify(hiddenThreads)); return GM_setValue("hiddenThreads/$BOARD/", JSON.stringify(hiddenThreads));
}; };
hideThread = function(div) { hideThread = function(div) {
var _c, a, n, name, p, span, text, trip; var _c, a, n, name, p, span, text, trip;
if (p = this.parentNode) { if ((p = this.parentNode)) {
div = p; div = p;
hiddenThreads.push({ hiddenThreads.push({
id: div.id, id: div.id,
timestamp: getTime() timestamp: getTime()
}); });
GM_setValue(("hiddenThreads/" + BOARD + "/"), JSON.stringify(hiddenThreads)); GM_setValue("hiddenThreads/$BOARD/", JSON.stringify(hiddenThreads));
} }
hide(div); hide(div);
if (getValue('Show Stubs')) { if (getValue('Show Stubs')) {
a = tag('a'); a = tag('a');
(span = $('.omittedposts', div)) ? (n = Number(span.textContent.match(/\d+/)[0])) : (n = 0); if ((span = $('.omittedposts', div))) {
n = Number(span.textContent.match(/\d+/)[0]);
} else {
n = 0;
};
n += $$('table', div).length; n += $$('table', div).length;
text = n === 1 ? "1 reply" : ("" + n + " replies"); text = n === 1 ? "1 reply" : "$n replies";
name = $('span.postername', div).textContent; name = $('span.postername', div).textContent;
trip = (typeof (_c = ($('span.postername + span.postertrip', div))) === "undefined" || _c == undefined ? undefined : _c.textContent) || ''; trip = (typeof (_c = ($('span.postername + span.postertrip', div))) === "undefined" || _c == undefined ? undefined : _c.textContent) || '';
a.textContent = ("[ + ] " + name + trip + " (" + text + ")"); a.textContent = "[ + ] $name$trip ($text)";
a.className = 'pointer'; a.className = 'pointer';
a.addEventListener('click', showThread, true); a.addEventListener('click', showThread, true);
return inBefore(div, a); return inBefore(div, a);
@ -366,7 +377,7 @@ cursor: pointer; \
a.addEventListener('click', hideThread, true); a.addEventListener('click', hideThread, true);
div.appendChild(a); div.appendChild(a);
inBefore(current, div); inBefore(current, div);
while (!current.clear) { while ((!current.clear)) {
div.appendChild(current); div.appendChild(current);
current = div.nextSibling; current = div.nextSibling;
} }
@ -377,7 +388,9 @@ cursor: pointer; \
_d = hiddenThreads; _d = hiddenThreads;
for (_c = 0, _e = _d.length; _c < _e; _c++) { for (_c = 0, _e = _d.length; _c < _e; _c++) {
hidden = _d[_c]; hidden = _d[_c];
id === hidden.id ? hideThread(div) : null; if (id === hidden.id) {
hideThread(div);
};
} }
current = current.nextSibling.nextSibling; current = current.nextSibling.nextSibling;
return current.nodeName !== 'CENTER' ? threadF(current) : null; return current.nodeName !== 'CENTER' ? threadF(current) : null;
@ -390,17 +403,17 @@ cursor: pointer; \
remove(div); remove(div);
id = $('td.reply, td.replyhl', table).id; id = $('td.reply, td.replyhl', table).id;
slice(hiddenReplies, id); slice(hiddenReplies, id);
return GM_setValue(("hiddenReplies/" + BOARD + "/"), JSON.stringify(hiddenReplies)); return GM_setValue("hiddenReplies/$BOARD/", JSON.stringify(hiddenReplies));
}; };
hideReply = function(reply) { hideReply = function(reply) {
var _c, a, div, name, p, table, trip; var _c, a, div, name, p, table, trip;
if (p = this.parentNode) { if ((p = this.parentNode)) {
reply = p.nextSibling; reply = p.nextSibling;
hiddenReplies.push({ hiddenReplies.push({
id: reply.id, id: reply.id,
timestamp: getTime() timestamp: getTime()
}); });
GM_setValue(("hiddenReplies/" + BOARD + "/"), JSON.stringify(hiddenReplies)); GM_setValue("hiddenReplies/$BOARD/", JSON.stringify(hiddenReplies));
} }
name = $('span.commentpostername', reply).textContent; name = $('span.commentpostername', reply).textContent;
trip = (typeof (_c = ($('span.postertrip', reply))) === "undefined" || _c == undefined ? undefined : _c.textContent) || ''; trip = (typeof (_c = ($('span.postertrip', reply))) === "undefined" || _c == undefined ? undefined : _c.textContent) || '';
@ -408,7 +421,7 @@ cursor: pointer; \
hide(table); hide(table);
if (getValue('Show Stubs')) { if (getValue('Show Stubs')) {
a = tag('a'); a = tag('a');
a.textContent = ("[ + ] " + name + " " + trip); a.textContent = "[ + ] $name $trip";
a.className = 'pointer'; a.className = 'pointer';
a.addEventListener('click', showReply, true); a.addEventListener('click', showReply, true);
div = tag('div'); div = tag('div');
@ -434,7 +447,7 @@ cursor: pointer; \
}; };
iframeLoad = function() { iframeLoad = function() {
var error, qr, span; var error, qr, span;
if (iframeLoop = !iframeLoop) { if ((iframeLoop = !iframeLoop)) {
return null; return null;
} }
$('iframe').src = 'about:blank'; $('iframe').src = 'about:blank';
@ -488,7 +501,9 @@ cursor: pointer; \
closeB.addEventListener('click', close, true); closeB.addEventListener('click', close, true);
div.appendChild(closeB); div.appendChild(closeB);
clone = $('form[name="post"]').cloneNode(true); clone = $('form[name="post"]').cloneNode(true);
(bf = $('.bf', clone)) ? remove(bf) : null; if ((bf = $('.bf', clone))) {
remove(bf);
};
clone.addEventListener('submit', submit, true); clone.addEventListener('submit', submit, true);
clone.target = 'iframe'; clone.target = 'iframe';
if (!REPLY) { if (!REPLY) {
@ -508,7 +523,11 @@ cursor: pointer; \
textarea.value += '>>' + this.parentNode.id.match(/\d+$/)[0] + '\n'; textarea.value += '>>' + this.parentNode.id.match(/\d+$/)[0] + '\n';
selection = window.getSelection(); selection = window.getSelection();
id = typeof (_c = (x('preceding::span[@id][1]', selection.anchorNode))) === "undefined" || _c == undefined ? undefined : _c.id; id = typeof (_c = (x('preceding::span[@id][1]', selection.anchorNode))) === "undefined" || _c == undefined ? undefined : _c.id;
id === this.parentNode.id ? (selText = selection.toString()) ? textarea.value += (">" + selText + "\n") : null : null; if (id === this.parentNode.id) {
if ((selText = selection.toString())) {
textarea.value += ">$selText\n";
};
};
return null; return null;
}; };
watch = function() { watch = function() {
@ -516,7 +535,7 @@ cursor: pointer; \
id = this.nextSibling.name; id = this.nextSibling.name;
if (this.src[0] === 'd') { if (this.src[0] === 'd') {
this.src = favNormal; this.src = favNormal;
text = ("/" + BOARD + "/ - ") + x('following-sibling::blockquote', this).textContent.slice(0, 25); text = "/$BOARD/ - " + x('following-sibling::blockquote', this).textContent.slice(0, 25);
watched[BOARD] = watched[BOARD] || []; watched[BOARD] = watched[BOARD] || [];
watched[BOARD].push({ watched[BOARD].push({
id: id, id: id,
@ -538,20 +557,21 @@ cursor: pointer; \
watched[board] = slice(watched[board], id); watched[board] = slice(watched[board], id);
GM_setValue('watched', JSON.stringify(watched)); GM_setValue('watched', JSON.stringify(watched));
watcherUpdate(); watcherUpdate();
if ((input = $("input[name=\"" + id + "\"]"))) { if ((input = $("input[name=\"$id\"]"))) {
favicon = input.previousSibling; favicon = input.previousSibling;
favicon.src = favEmpty; return (favicon.src = favEmpty);
return favicon.src;
} }
}; };
watcherUpdate = function() { watcherUpdate = function() {
var _c, _d, _e, _f, a, div, link, old; var _c, _d, _e, _f, _g, a, div, link, old;
div = tag('div'); div = tag('div');
_c = watched; _d = watched;
for (board in _c) { if (__hasProp.call(_c, board)) { for (board in _d) {
_e = watched[board]; if (!__hasProp.call(_d, board)) continue;
for (_d = 0, _f = _e.length; _d < _f; _d++) { _c = _d[board];
thread = _e[_d]; _f = watched[board];
for (_e = 0, _g = _f.length; _e < _g; _e++) {
thread = _f[_e];
a = tag('a'); a = tag('a');
a.textContent = 'X'; a.textContent = 'X';
a.className = 'pointer'; a.className = 'pointer';
@ -560,11 +580,11 @@ cursor: pointer; \
div.appendChild(document.createTextNode(' ')); div.appendChild(document.createTextNode(' '));
link = tag('a'); link = tag('a');
link.textContent = thread.text; link.textContent = thread.text;
link.href = ("/" + board + "/res/" + (thread.id)); link.href = "/$board/res/${thread.id}";
div.appendChild(link); div.appendChild(link);
div.appendChild(tag('br')); div.appendChild(tag('br'));
} }
}} }
old = $('#watcher div:last-child'); old = $('#watcher div:last-child');
return replace(old, div); return replace(old, div);
}; };
@ -610,7 +630,7 @@ cursor: pointer; \
span = this; span = this;
if (span.textContent[0] === '-') { if (span.textContent[0] === '-') {
num = board === 'b' ? 3 : 5; num = board === 'b' ? 3 : 5;
table = x(("following::br[@clear][1]/preceding::table[" + num + "]"), span); table = x("following::br[@clear][1]/preceding::table[$num]", span);
while ((prev = table.previousSibling) && (prev.nodeName === 'TABLE')) { while ((prev = table.previousSibling) && (prev.nodeName === 'TABLE')) {
remove(prev); remove(prev);
} }
@ -630,7 +650,7 @@ cursor: pointer; \
r.onload = function() { r.onload = function() {
return onloadThread(this.responseText, span); return onloadThread(this.responseText, span);
}; };
r.open('GET', ("res/" + id), true); r.open('GET', "res/$id", true);
r.send(); r.send();
return xhrs.push({ return xhrs.push({
r: r, r: r,
@ -652,12 +672,13 @@ cursor: pointer; \
_f = replies; _f = replies;
for (_e = 0, _g = _f.length; _e < _g; _e++) { for (_e = 0, _g = _f.length; _e < _g; _e++) {
reply = _f[_e]; reply = _f[_e];
reply.id === id ? (html = $('blockquote', reply).innerHTML) : null; if (reply.id === id) {
html = $('blockquote', reply).innerHTML;
};
} }
} }
bq = x('ancestor::blockquote', a); bq = x('ancestor::blockquote', a);
bq.innerHTML = html; return (bq.innerHTML = html);
return bq.innerHTML;
}; };
expandComment = function(e) { expandComment = function(e) {
var a, href; var a, href;
@ -697,7 +718,7 @@ cursor: pointer; \
autoWatch = function() { autoWatch = function() {
var autoText; var autoText;
autoText = $('textarea', this).value.slice(0, 25); autoText = $('textarea', this).value.slice(0, 25);
return GM_setValue('autoText', ("/" + BOARD + "/ - " + autoText)); return GM_setValue('autoText', "/$BOARD/ - $autoText");
}; };
stopPropagation = function(e) { stopPropagation = function(e) {
return e.stopPropagation(); return e.stopPropagation();
@ -705,13 +726,11 @@ cursor: pointer; \
replyNav = function() { replyNav = function() {
var direction, op; var direction, op;
if (REPLY) { if (REPLY) {
window.location = this.textContent === '▲' ? '#navtop' : '#navbot'; return (window.location = this.textContent === '▲' ? '#navtop' : '#navbot');
return window.location;
} else { } else {
direction = this.textContent === '▲' ? 'preceding' : 'following'; direction = this.textContent === '▲' ? 'preceding' : 'following';
op = x(("" + direction + "::span[starts-with(@id, 'nothread')][1]"), this).id; op = x("$direction::span[starts-with(@id, 'nothread')][1]", this).id;
window.location = ("#" + op); return (window.location = "#$op");
return window.location;
} }
}; };
text = $('#navtopr a').nextSibling; text = $('#navtopr a').nextSibling;
@ -721,30 +740,32 @@ cursor: pointer; \
a.addEventListener('click', options, true); a.addEventListener('click', options, true);
inBefore(text, document.createTextNode(' / ')); inBefore(text, document.createTextNode(' / '));
inBefore(text, a); inBefore(text, a);
getValue('Reply Hiding') ? callbacks.push(function(root) { if (getValue('Reply Hiding')) {
var _c, _d, _e, _f, _g, _h, _i, _j, next, obj, td, tds; callbacks.push(function(root) {
tds = $$('td.doubledash', root); var _c, _d, _e, _f, _g, _h, _i, _j, next, obj, td, tds;
_c = []; _e = tds; tds = $$('td.doubledash', root);
for (_d = 0, _f = _e.length; _d < _f; _d++) { _c = []; _e = tds;
td = _e[_d]; for (_d = 0, _f = _e.length; _d < _f; _d++) {
_c.push((function() { td = _e[_d];
a = tag('a'); _c.push((function() {
a.textContent = '[ - ]'; a = tag('a');
a.className = 'pointer'; a.textContent = '[ - ]';
a.addEventListener('click', hideReply, true); a.className = 'pointer';
replace(td.firstChild, a); a.addEventListener('click', hideReply, true);
next = td.nextSibling; replace(td.firstChild, a);
id = next.id; next = td.nextSibling;
_g = []; _i = hiddenReplies; id = next.id;
for (_h = 0, _j = _i.length; _h < _j; _h++) { _g = []; _i = hiddenReplies;
obj = _i[_h]; for (_h = 0, _j = _i.length; _h < _j; _h++) {
_g.push(obj.id === id ? hideReply(next) : null); obj = _i[_h];
} _g.push(obj.id === id ? hideReply(next) : null);
return _g; }
})()); return _g;
} })());
return _c; }
}) : null; return _c;
});
};
if (getValue('Quick Reply')) { if (getValue('Quick Reply')) {
iframe = tag('iframe'); iframe = tag('iframe');
hide(iframe); hide(iframe);
@ -762,23 +783,25 @@ cursor: pointer; \
return _c; return _c;
}); });
} }
getValue('Quick Report') ? callbacks.push(function(root) { if (getValue('Quick Report')) {
var _c, _d, _e, _f, arr, el; callbacks.push(function(root) {
arr = $$('span[id^=no]', root); var _c, _d, _e, _f, arr, el;
_c = []; _e = arr; arr = $$('span[id^=no]', root);
for (_d = 0, _f = _e.length; _d < _f; _d++) { _c = []; _e = arr;
el = _e[_d]; for (_d = 0, _f = _e.length; _d < _f; _d++) {
_c.push((function() { el = _e[_d];
a = tag('a'); _c.push((function() {
a.textContent = '[ ! ]'; a = tag('a');
a.className = 'pointer'; a.textContent = '[ ! ]';
a.addEventListener('click', report, true); a.className = 'pointer';
inAfter(el, a); a.addEventListener('click', report, true);
return inAfter(el, document.createTextNode(' ')); inAfter(el, a);
})()); return inAfter(el, document.createTextNode(' '));
} })());
return _c; }
}) : null; return _c;
});
};
if (getValue('Thread Watcher')) { if (getValue('Thread Watcher')) {
watcher = tag('div'); watcher = tag('div');
watcher.innerHTML = '<div class="move">Thread Watcher</div><div></div>'; watcher.innerHTML = '<div class="move">Thread Watcher</div><div></div>';
@ -809,47 +832,51 @@ cursor: pointer; \
inBefore(input, img); inBefore(input, img);
} }
} }
getValue('Anonymize') ? callbacks.push(function(root) { if (getValue('Anonymize')) {
var _i, _j, _k, _l, _m, _n, _o, name, names, trip, trips; callbacks.push(function(root) {
names = $$('span.postername, span.commentpostername', root); var _i, _j, _k, _l, _m, _n, _o, name, names, trip, trips;
_j = names; names = $$('span.postername, span.commentpostername', root);
for (_i = 0, _k = _j.length; _i < _k; _i++) { _j = names;
name = _j[_i]; for (_i = 0, _k = _j.length; _i < _k; _i++) {
name.innerHTML = 'Anonymous'; name = _j[_i];
} name.innerHTML = 'Anonymous';
trips = $$('span.postertrip', root); }
_l = []; _n = trips; trips = $$('span.postertrip', root);
for (_m = 0, _o = _n.length; _m < _o; _m++) { _l = []; _n = trips;
trip = _n[_m]; for (_m = 0, _o = _n.length; _m < _o; _m++) {
_l.push(trip.parentNode.nodeName === 'A' ? remove(trip.parentNode) : remove(trip)); trip = _n[_m];
} _l.push(trip.parentNode.nodeName === 'A' ? remove(trip.parentNode) : remove(trip));
return _l; }
}) : null; return _l;
getValue('Reply Navigation') ? callbacks.push(function(root) { });
var _i, _j, _k, _l, arr, down, el, span, up; };
arr = $$('span[id^=norep]', root); if (getValue('Reply Navigation')) {
_i = []; _k = arr; callbacks.push(function(root) {
for (_j = 0, _l = _k.length; _j < _l; _j++) { var _i, _j, _k, _l, arr, down, el, span, up;
el = _k[_j]; arr = $$('span[id^=norep]', root);
_i.push((function() { _i = []; _k = arr;
span = tag('span'); for (_j = 0, _l = _k.length; _j < _l; _j++) {
up = tag('a'); el = _k[_j];
up.textContent = '▲'; _i.push((function() {
up.className = 'pointer'; span = tag('span');
up.addEventListener('click', replyNav, true); up = tag('a');
down = tag('a'); up.textContent = '▲';
down.textContent = '▼'; up.className = 'pointer';
down.className = 'pointer'; up.addEventListener('click', replyNav, true);
down.addEventListener('click', replyNav, true); down = tag('a');
span.appendChild(document.createTextNode(' ')); down.textContent = '▼';
span.appendChild(up); down.className = 'pointer';
span.appendChild(document.createTextNode(' ')); down.addEventListener('click', replyNav, true);
span.appendChild(down); span.appendChild(document.createTextNode(' '));
return inAfter(el, span); span.appendChild(up);
})()); span.appendChild(document.createTextNode(' '));
} span.appendChild(down);
return _i; return inAfter(el, span);
}) : null; })());
}
return _i;
});
};
if (!REPLY) { if (!REPLY) {
if (getValue('Thread Hiding')) { if (getValue('Thread Hiding')) {
delform = $('form[name=delform]'); delform = $('form[name=delform]');
@ -857,7 +884,9 @@ cursor: pointer; \
threadF(delform.firstChild); threadF(delform.firstChild);
document.removeEventListener('DOMNodeInserted', stopPropagation, true); document.removeEventListener('DOMNodeInserted', stopPropagation, true);
} }
getValue('Auto Watch') ? $('form[name="post"]').addEventListener('submit', autoWatch, true) : null; if (getValue('Auto Watch')) {
$('form[name="post"]').addEventListener('submit', autoWatch, true);
};
if (getValue('Thread Navigation')) { if (getValue('Thread Navigation')) {
arr = $$('div > span.filesize, form > span.filesize'); arr = $$('div > span.filesize, form > span.filesize');
i = 0; i = 0;
@ -870,10 +899,10 @@ cursor: pointer; \
up.className = 'pointer'; up.className = 'pointer';
if (i !== 0) { if (i !== 0) {
up.textContent = '▲'; up.textContent = '▲';
up.href = ("#" + i); up.href = "#$i";
} else if (PAGENUM !== 0) { } else if (PAGENUM !== 0) {
up.textContent = '◀'; up.textContent = '◀';
up.href = ("" + (PAGENUM - 1)); up.href = "${PAGENUM - 1}";
} else { } else {
up.textContent = '▲'; up.textContent = '▲';
up.href = "#navtop"; up.href = "#navtop";
@ -889,14 +918,16 @@ cursor: pointer; \
span.appendChild(down); span.appendChild(down);
if (i1 === l1) { if (i1 === l1) {
down.textContent = '▶'; down.textContent = '▶';
down.href = ("" + (PAGENUM + 1) + "#1"); down.href = "${PAGENUM + 1}#1";
} else { } else {
down.textContent = '▼'; down.textContent = '▼';
down.href = ("#" + i1); down.href = "#$i1";
} }
inBefore(el, span); inBefore(el, span);
} }
location.hash === '#1' ? (window.location = window.location) : null; if (location.hash === '#1') {
window.location = window.location;
};
} }
if (getValue('Thread Expansion')) { if (getValue('Thread Expansion')) {
omitted = $$('span.omittedposts'); omitted = $$('span.omittedposts');
@ -905,7 +936,7 @@ cursor: pointer; \
span = _m[_l]; span = _m[_l];
a = tag('a'); a = tag('a');
a.className = 'pointer omittedposts'; a.className = 'pointer omittedposts';
a.textContent = ("+ " + (span.textContent)); a.textContent = "+ ${span.textContent}";
a.addEventListener('click', expandThread, true); a.addEventListener('click', expandThread, true);
replace(span, a); replace(span, a);
} }