some fixes

This commit is contained in:
Nicolas Stepien 2012-09-15 04:39:24 +02:00
parent 5b399388f6
commit 7ea4a52433
2 changed files with 11 additions and 6 deletions

View File

@ -793,6 +793,9 @@
} }
for (_l = 0, _len3 = quotelinks.length; _l < _len3; _l++) { for (_l = 0, _len3 = quotelinks.length; _l < _len3; _l++) {
quotelink = quotelinks[_l]; quotelink = quotelinks[_l];
if ($.hasClass(quotelink, 'deadlink')) {
continue;
}
if (Get.postDataFromLink(quotelink).postID === this.ID) { if (Get.postDataFromLink(quotelink).postID === this.ID) {
$.add(quotelink, $.tn('\u00A0(Dead)')); $.add(quotelink, $.tn('\u00A0(Dead)'));
} }
@ -1681,7 +1684,7 @@
href: Redirect.thread(board, 0, ID), href: Redirect.thread(board, 0, ID),
className: 'deadlink', className: 'deadlink',
target: '_blank', target: '_blank',
textContent: this.isDead ? quote : "" + quote + "\u00A0(Dead)" textContent: "" + quote + "\u00A0(Dead)"
}); });
if (Redirect.post(board, ID)) { if (Redirect.post(board, ID)) {
$.addClass(a, 'quotelink'); $.addClass(a, 'quotelink');
@ -1692,7 +1695,9 @@
if (this.quotes.indexOf(quoteID) === -1) { if (this.quotes.indexOf(quoteID) === -1) {
this.quotes.push(quoteID); this.quotes.push(quoteID);
} }
this.nodes.quotelinks.push(a); if ($.hasClass(a, 'quotelink')) {
this.nodes.quotelinks.push(a);
}
nodes.push(a); nodes.push(a);
data = data.slice(index + quote.length); data = data.slice(index + quote.length);
} }

View File

@ -636,6 +636,7 @@ class Post
for post in [post].concat post.clones for post in [post].concat post.clones
quotelinks.push.apply quotelinks, Array::slice.call post.nodes.backlinks quotelinks.push.apply quotelinks, Array::slice.call post.nodes.backlinks
for quotelink in quotelinks for quotelink in quotelinks
continue if $.hasClass quotelink, 'deadlink'
if Get.postDataFromLink(quotelink).postID is @ID if Get.postDataFromLink(quotelink).postID is @ID
$.add quotelink, $.tn '\u00A0(Dead)' $.add quotelink, $.tn '\u00A0(Dead)'
return return
@ -1629,9 +1630,7 @@ Quotify =
href: Redirect.thread board, 0, ID href: Redirect.thread board, 0, ID
className: 'deadlink' className: 'deadlink'
target: '_blank' target: '_blank'
# Don't (Dead) when quotifying in an archived post, textContent: "#{quote}\u00A0(Dead)"
# and we don't know anything about the post.
textContent: if @isDead then quote else "#{quote}\u00A0(Dead)"
if Redirect.post board, ID if Redirect.post board, ID
$.addClass a, 'quotelink' $.addClass a, 'quotelink'
a.setAttribute 'data-board', board a.setAttribute 'data-board', board
@ -1639,7 +1638,8 @@ Quotify =
if @quotes.indexOf(quoteID) is -1 if @quotes.indexOf(quoteID) is -1
@quotes.push quoteID @quotes.push quoteID
@nodes.quotelinks.push a if $.hasClass a, 'quotelink'
@nodes.quotelinks.push a
nodes.push a nodes.push a
data = data[index + quote.length..] data = data[index + quote.length..]