Handle bans with the updater.

This commit is contained in:
Nicolas Stepien 2011-10-08 23:18:23 +02:00
parent 2915987294
commit 41bf1934ad
2 changed files with 16 additions and 7 deletions

View File

@ -1994,17 +1994,22 @@
Favicon.update();
return;
}
id = Number(((_ref2 = $('td[id]', updater.br.previousElementSibling)) != null ? _ref2.id : void 0) || 0);
arr = [];
updater.timer.textContent = '-' + conf['Interval'];
body = $.el('body', {
innerHTML: this.responseText
});
if ($('title', body).textContent === '4chan - Banned') {
updater.count.textContent = 'banned';
updater.count.className = 'error';
return;
}
replies = $$('.reply', body);
id = Number(((_ref2 = $('td[id]', updater.br.previousElementSibling)) != null ? _ref2.id : void 0) || 0);
arr = [];
while ((reply = replies.pop()) && (reply.id > id)) {
arr.push(reply.parentNode.parentNode.parentNode);
}
scroll = conf['Scrolling'] && updater.focus && arr.length && (d.body.scrollHeight - d.body.clientHeight - window.scrollY < 20);
updater.timer.textContent = '-' + conf['Interval'];
if (conf['Verbose']) {
updater.count.textContent = '+' + arr.length;
if (arr.length === 0) {

View File

@ -1499,18 +1499,22 @@ updater =
Favicon.update()
return
id = Number $('td[id]', updater.br.previousElementSibling)?.id or 0
updater.timer.textContent = '-' + conf['Interval']
arr = []
body = $.el 'body',
innerHTML: @responseText
if $('title', body).textContent is '4chan - Banned'
updater.count.textContent = 'banned'
updater.count.className = 'error'
return
replies = $$ '.reply', body
id = Number $('td[id]', updater.br.previousElementSibling)?.id or 0
arr = []
while (reply = replies.pop()) and (reply.id > id)
arr.push reply.parentNode.parentNode.parentNode #table
scroll = conf['Scrolling'] && updater.focus && arr.length && (d.body.scrollHeight - d.body.clientHeight - window.scrollY < 20)
updater.timer.textContent = '-' + conf['Interval']
if conf['Verbose']
updater.count.textContent = '+' + arr.length
if arr.length is 0