Backlinks can now be retrieved even if the post's not on the page. Don't remove OP backlinks after unexpending a thread.

This commit is contained in:
Nicolas Stepien 2012-06-19 14:03:47 +02:00
parent 76ae3068d8
commit eca5a9a58a
2 changed files with 4 additions and 12 deletions

View File

@ -834,7 +834,7 @@
return _results;
},
toggle: function(thread) {
var a, backlink, num, pathname, replies, reply, _i, _j, _len, _len1, _ref;
var a, num, pathname, replies, reply, _i, _len;
pathname = "/" + g.BOARD + "/res/" + thread.id.slice(1);
a = $('.summary', thread);
switch (a.textContent[0]) {
@ -867,13 +867,6 @@
reply = replies[_i];
$.rm(reply);
}
_ref = $$('.backlink', a.previousElementSibling);
for (_j = 0, _len1 = _ref.length; _j < _len1; _j++) {
backlink = _ref[_j];
if (!$.id(backlink.hash.slice(1))) {
$.rm(backlink);
}
}
}
},
parse: function(req, thread, a) {
@ -3366,7 +3359,7 @@
}
}
a = $.el('a', {
href: "#p" + post.ID,
href: "/" + g.BOARD + "/res/" + post.threadID + "#p" + post.ID,
className: post.el.hidden ? 'filtered backlink' : 'backlink',
textContent: QuoteBacklink.funk(post.ID)
});

View File

@ -665,8 +665,6 @@ ExpandThread =
replies.splice replies.length - num, num
for reply in replies
$.rm reply
for backlink in $$ '.backlink', a.previousElementSibling
$.rm backlink unless $.id backlink.hash[1..]
return
parse: (req, thread, a) ->
@ -697,6 +695,7 @@ ExpandThread =
for post in $$ '.summary ~ .replyContainer', a.parentNode
$.rm post
for backlink in $$ '.backlink', a.previousElementSibling
# Keep backlinks from other threads.
$.rm backlink unless $.id backlink.hash[1..]
$.after a, nodes
@ -2625,7 +2624,7 @@ QuoteBacklink =
# Duplicate quotes get overwritten.
quotes[qid] = true
a = $.el 'a',
href: "#p#{post.ID}"
href: "/#{g.BOARD}/res/#{post.threadID}#p#{post.ID}"
className: if post.el.hidden then 'filtered backlink' else 'backlink'
textContent: QuoteBacklink.funk post.ID
for qid of quotes