Small improvements in the updater.cb.update
This commit is contained in:
parent
37c20165d6
commit
1c2eb0bf9b
@ -1693,6 +1693,7 @@
|
|||||||
}, html);
|
}, html);
|
||||||
updater.count = $('#count', dialog);
|
updater.count = $('#count', dialog);
|
||||||
updater.timer = $('#timer', dialog);
|
updater.timer = $('#timer', dialog);
|
||||||
|
updater.br = $('br[clear]');
|
||||||
_ref = $$('input', dialog);
|
_ref = $$('input', dialog);
|
||||||
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
||||||
input = _ref[_i];
|
input = _ref[_i];
|
||||||
@ -1740,7 +1741,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
update: function() {
|
update: function() {
|
||||||
var arr, body, br, id, input, replies, reply, scroll, _i, _len, _ref, _ref2;
|
var arr, body, id, input, replies, reply, scroll, _i, _len, _ref, _ref2;
|
||||||
if (this.status === 404) {
|
if (this.status === 404) {
|
||||||
updater.timer.textContent = '';
|
updater.timer.textContent = '';
|
||||||
updater.count.textContent = 404;
|
updater.count.textContent = 404;
|
||||||
@ -1757,13 +1758,12 @@
|
|||||||
Favicon.update();
|
Favicon.update();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
br = $('br[clear]');
|
id = Number(((_ref2 = $('td[id]', updater.br.previousElementSibling)) != null ? _ref2.id : void 0) || 0);
|
||||||
id = Number(((_ref2 = $('td[id]', br.previousElementSibling)) != null ? _ref2.id : void 0) || 0);
|
|
||||||
arr = [];
|
arr = [];
|
||||||
body = $.el('body', {
|
body = $.el('body', {
|
||||||
innerHTML: this.responseText
|
innerHTML: this.responseText
|
||||||
});
|
});
|
||||||
replies = $$('td[id]', body);
|
replies = $$('.reply', body);
|
||||||
while ((reply = replies.pop()) && (reply.id > id)) {
|
while ((reply = replies.pop()) && (reply.id > id)) {
|
||||||
arr.push(reply.parentNode.parentNode.parentNode);
|
arr.push(reply.parentNode.parentNode.parentNode);
|
||||||
}
|
}
|
||||||
@ -1778,7 +1778,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
while (reply = arr.pop()) {
|
while (reply = arr.pop()) {
|
||||||
$.before(br, reply);
|
$.before(updater.br, reply);
|
||||||
}
|
}
|
||||||
if (scroll) {
|
if (scroll) {
|
||||||
return scrollTo(0, d.body.scrollHeight);
|
return scrollTo(0, d.body.scrollHeight);
|
||||||
|
|||||||
@ -1397,6 +1397,7 @@ updater =
|
|||||||
|
|
||||||
updater.count = $ '#count', dialog
|
updater.count = $ '#count', dialog
|
||||||
updater.timer = $ '#timer', dialog
|
updater.timer = $ '#timer', dialog
|
||||||
|
updater.br = $ 'br[clear]'
|
||||||
|
|
||||||
for input in $$ 'input', dialog
|
for input in $$ 'input', dialog
|
||||||
if input.type is 'checkbox'
|
if input.type is 'checkbox'
|
||||||
@ -1445,13 +1446,12 @@ updater =
|
|||||||
Favicon.update()
|
Favicon.update()
|
||||||
return
|
return
|
||||||
|
|
||||||
br = $ 'br[clear]'
|
id = Number $('td[id]', updater.br.previousElementSibling)?.id or 0
|
||||||
id = Number $('td[id]', br.previousElementSibling)?.id or 0
|
|
||||||
|
|
||||||
arr = []
|
arr = []
|
||||||
body = $.el 'body',
|
body = $.el 'body',
|
||||||
innerHTML: @responseText
|
innerHTML: @responseText
|
||||||
replies = $$ 'td[id]', body
|
replies = $$ '.reply', body
|
||||||
while (reply = replies.pop()) and (reply.id > id)
|
while (reply = replies.pop()) and (reply.id > id)
|
||||||
arr.push reply.parentNode.parentNode.parentNode #table
|
arr.push reply.parentNode.parentNode.parentNode #table
|
||||||
|
|
||||||
@ -1467,7 +1467,7 @@ updater =
|
|||||||
|
|
||||||
#XXX add replies in correct order so backlinks resolve
|
#XXX add replies in correct order so backlinks resolve
|
||||||
while reply = arr.pop()
|
while reply = arr.pop()
|
||||||
$.before br, reply
|
$.before updater.br, reply
|
||||||
if scroll
|
if scroll
|
||||||
scrollTo 0, d.body.scrollHeight
|
scrollTo 0, d.body.scrollHeight
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user