Slight Comment Expansion optimization.
Sup @aeosynth.
This commit is contained in:
parent
dd77d0d89d
commit
8ed8309b31
@ -736,29 +736,17 @@
|
|||||||
}));
|
}));
|
||||||
},
|
},
|
||||||
parse: function(req, a, threadID, replyID) {
|
parse: function(req, a, threadID, replyID) {
|
||||||
var body, bq, post, quote, quotes, reply, _i, _j, _len, _len2, _ref;
|
var bq, doc, post, quote, quotes, _i, _len;
|
||||||
if (req.status !== 200) {
|
if (req.status !== 200) {
|
||||||
a.textContent = "" + req.status + " " + req.statusText;
|
a.textContent = "" + req.status + " " + req.statusText;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
body = $.el('body', {
|
doc = d.implementation.createHTMLDocument();
|
||||||
innerHTML: req.responseText
|
doc.documentElement.innerHTML = req.responseText;
|
||||||
});
|
bq = threadID === replyID ? $('blockquote', doc) : $('blockquote', doc.getElementById(replyID));
|
||||||
if (threadID === replyID) {
|
|
||||||
bq = $('blockquote', body);
|
|
||||||
} else {
|
|
||||||
_ref = $$('td[id]', body);
|
|
||||||
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
|
||||||
reply = _ref[_i];
|
|
||||||
if (reply.id === replyID) {
|
|
||||||
bq = $('blockquote', reply);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
quotes = $$('.quotelink', bq);
|
quotes = $$('.quotelink', bq);
|
||||||
for (_j = 0, _len2 = quotes.length; _j < _len2; _j++) {
|
for (_i = 0, _len = quotes.length; _i < _len; _i++) {
|
||||||
quote = quotes[_j];
|
quote = quotes[_i];
|
||||||
if (quote.getAttribute('href') === quote.hash) {
|
if (quote.getAttribute('href') === quote.hash) {
|
||||||
quote.pathname = "/" + g.BOARD + "/res/" + threadID;
|
quote.pathname = "/" + g.BOARD + "/res/" + threadID;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -637,18 +637,14 @@ ExpandComment =
|
|||||||
a.textContent = "#{req.status} #{req.statusText}"
|
a.textContent = "#{req.status} #{req.statusText}"
|
||||||
return
|
return
|
||||||
|
|
||||||
body = $.el 'body',
|
doc = d.implementation.createHTMLDocument()
|
||||||
innerHTML: req.responseText
|
doc.documentElement.innerHTML = req.responseText
|
||||||
|
|
||||||
if threadID is replyID #OP
|
bq =
|
||||||
bq = $ 'blockquote', body
|
if threadID is replyID # OP
|
||||||
else
|
$ 'blockquote', doc
|
||||||
#css selectors don't like ids starting with numbers,
|
else
|
||||||
# getElementById only works for root document.
|
$ 'blockquote', doc.getElementById replyID
|
||||||
for reply in $$ 'td[id]', body
|
|
||||||
if reply.id == replyID
|
|
||||||
bq = $ 'blockquote', reply
|
|
||||||
break
|
|
||||||
quotes = $$ '.quotelink', bq
|
quotes = $$ '.quotelink', bq
|
||||||
for quote in quotes
|
for quote in quotes
|
||||||
if quote.getAttribute('href') is quote.hash
|
if quote.getAttribute('href') is quote.hash
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user