Don't break linkifying when expanding comments.

This commit is contained in:
Nicolas Stepien 2012-09-10 17:46:07 +02:00
parent e603f40925
commit 040b314689
2 changed files with 13 additions and 9 deletions

View File

@ -874,7 +874,7 @@
});
},
parse: function(req, a, threadID, replyID) {
var bq, href, post, posts, quote, quotes, spoilerRange, _i, _j, _len, _len1;
var bq, clone, href, post, posts, quote, quotes, spoilerRange, _i, _j, _len, _len1;
if (req.status !== 200) {
a.textContent = "" + req.status + " " + req.statusText;
return;
@ -895,8 +895,9 @@
return;
}
bq = $.id("m" + replyID);
bq.innerHTML = post.com;
quotes = bq.getElementsByClassName('quotelink');
clone = bq.cloneNode(false);
clone.innerHTML = post.com;
quotes = clone.getElementsByClassName('quotelink');
for (_j = 0, _len1 = quotes.length; _j < _len1; _j++) {
quote = quotes[_j];
href = quote.getAttribute('href');
@ -906,7 +907,7 @@
quote.href = "res/" + href;
}
post = {
blockquote: bq,
blockquote: clone,
threadID: threadID,
quotes: quotes,
backlinks: []
@ -926,7 +927,8 @@
if (Conf['Indicate Cross-thread Quotes']) {
QuoteCT.node(post);
}
return Main.prettify(bq);
$.replace(bq, clone);
return Main.prettify(clone);
}
};

View File

@ -729,14 +729,15 @@ ExpandComment =
return
bq = $.id "m#{replyID}"
bq.innerHTML = post.com
quotes = bq.getElementsByClassName 'quotelink'
clone = bq.cloneNode false
clone.innerHTML = post.com
quotes = clone.getElementsByClassName 'quotelink'
for quote in quotes
href = quote.getAttribute 'href'
continue if href[0] is '/' # Cross-board quote
quote.href = "res/#{href}" # Fix pathnames
post =
blockquote: bq
blockquote: clone
threadID: threadID
quotes: quotes
backlinks: []
@ -750,7 +751,8 @@ ExpandComment =
QuoteOP.node post
if Conf['Indicate Cross-thread Quotes']
QuoteCT.node post
Main.prettify bq
$.replace bq, clone
Main.prettify clone
ExpandThread =
init: ->