Fix cross quotes within cross quotes; We need to go deeper; God damn moot

This commit is contained in:
Nicolas Stepien 2011-09-16 23:07:37 +02:00
parent 61167dc792
commit e9343bff56
3 changed files with 15 additions and 6 deletions

View File

@ -652,7 +652,7 @@
} }
}, },
parse: function(req, pathname, thread, a) { parse: function(req, pathname, thread, a) {
var body, br, link, next, quote, reply, table, tables, _i, _j, _k, _len, _len2, _len3, _ref, _ref2, _results; var body, br, href, link, next, quote, reply, table, tables, _i, _j, _k, _len, _len2, _len3, _ref, _ref2, _results;
if (req.status !== 200) { if (req.status !== 200) {
a.textContent = "" + req.status + " " + req.statusText; a.textContent = "" + req.status + " " + req.statusText;
$.unbind(a, 'click', expandThread.cb.toggle); $.unbind(a, 'click', expandThread.cb.toggle);
@ -672,8 +672,10 @@
_ref2 = $$('a.quotelink', reply); _ref2 = $$('a.quotelink', reply);
for (_j = 0, _len2 = _ref2.length; _j < _len2; _j++) { for (_j = 0, _len2 = _ref2.length; _j < _len2; _j++) {
quote = _ref2[_j]; quote = _ref2[_j];
if (quote.getAttribute('href') === quote.hash) { if ((href = quote.getAttribute('href')) === quote.hash) {
quote.pathname = pathname; quote.pathname = pathname;
} else if (href !== quote.href) {
quote.href = "res/" + href;
} }
} }
link = $('a.quotejs', reply); link = $('a.quotejs', reply);
@ -2289,7 +2291,7 @@
return $.addClass(this, 'inlined'); return $.addClass(this, 'inlined');
}, },
parse: function(req, pathname, id, threadID, inline) { parse: function(req, pathname, id, threadID, inline) {
var body, html, link, newInline, op, quote, reply, _i, _j, _len, _len2, _ref, _ref2; var body, href, html, link, newInline, op, quote, reply, _i, _j, _len, _len2, _ref, _ref2;
if (!inline.parentNode) { if (!inline.parentNode) {
return; return;
} }
@ -2317,8 +2319,10 @@
_ref2 = $$('a.quotelink', newInline); _ref2 = $$('a.quotelink', newInline);
for (_j = 0, _len2 = _ref2.length; _j < _len2; _j++) { for (_j = 0, _len2 = _ref2.length; _j < _len2; _j++) {
quote = _ref2[_j]; quote = _ref2[_j];
if (quote.getAttribute('href') === quote.hash) { if ((href = quote.getAttribute('href')) === quote.hash) {
quote.pathname = pathname; quote.pathname = pathname;
} else if (!g.REPLY && href !== quote.href) {
quote.href = "res/" + href;
} }
} }
link = $('a.quotejs', newInline); link = $('a.quotejs', newInline);

View File

@ -1,6 +1,7 @@
master master
- mayhem - mayhem
do not display inlined quotes within the quote preview do not display inlined quotes within the quote preview
fix cross threads quotes in expanded threads or inlined cross quotes
2.19.3 2.19.3
- mayhem - mayhem

View File

@ -476,8 +476,10 @@ expandThread =
for reply in $$ 'td[id]', body for reply in $$ 'td[id]', body
for quote in $$ 'a.quotelink', reply for quote in $$ 'a.quotelink', reply
if quote.getAttribute('href') is quote.hash if (href = quote.getAttribute('href')) is quote.hash #add pathname to normal quotes
quote.pathname = pathname quote.pathname = pathname
else if href isnt quote.href #fix x-thread links, not x-board ones
quote.href = "res/#{href}"
link = $ 'a.quotejs', reply link = $ 'a.quotejs', reply
link.href = "res/#{thread.firstChild.id}##{reply.id}" link.href = "res/#{thread.firstChild.id}##{reply.id}"
link.nextSibling.href = "res/#{thread.firstChild.id}#q#{reply.id}" link.nextSibling.href = "res/#{thread.firstChild.id}#q#{reply.id}"
@ -1786,8 +1788,10 @@ quoteInline =
break break
newInline = quoteInline.table id, html newInline = quoteInline.table id, html
for quote in $$ 'a.quotelink', newInline for quote in $$ 'a.quotelink', newInline
if quote.getAttribute('href') is quote.hash if (href = quote.getAttribute('href')) is quote.hash #add pathname to normal quotes
quote.pathname = pathname quote.pathname = pathname
else if !g.REPLY and href isnt quote.href #fix x-thread links, not x-board ones
quote.href = "res/#{href}"
link = $ 'a.quotejs', newInline link = $ 'a.quotejs', newInline
link.href = "#{pathname}##{id}" link.href = "#{pathname}##{id}"
link.nextSibling.href = "#{pathname}#q#{id}" link.nextSibling.href = "#{pathname}#q#{id}"