Eep, missed a very small, very important detail
I'm not going to lie, I'm kinda tired right now.
This commit is contained in:
parent
c879594909
commit
99343e8fc0
@ -3110,20 +3110,20 @@
|
||||
allQuotelinksLinkingTo: function(post) {
|
||||
var ID, handleQuotes, quote, quotedPost, quotelinks, quoterPost, _i, _len, _ref, _ref1, _ref2;
|
||||
quotelinks = [];
|
||||
handleQuotes = function(post) {
|
||||
handleQuotes = function(post, type) {
|
||||
var clone, _i, _len, _ref;
|
||||
quotelinks.push.apply(quotelinks, post.nodes.quotelinks);
|
||||
quotelinks.push.apply(quotelinks, post.nodes[type]);
|
||||
_ref = post.clones;
|
||||
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
||||
clone = _ref[_i];
|
||||
quotelinks.push.apply(quotelinks, clone.nodes.quotelinks);
|
||||
quotelinks.push.apply(quotelinks, clone.nodes[type]);
|
||||
}
|
||||
};
|
||||
_ref = g.posts;
|
||||
for (ID in _ref) {
|
||||
quoterPost = _ref[ID];
|
||||
if (_ref1 = post.fullID, __indexOf.call(quoterPost.quotes, _ref1) >= 0) {
|
||||
handleQuotes(quoterPost);
|
||||
handleQuotes(quoterPost, 'quotelinks');
|
||||
}
|
||||
}
|
||||
if (Conf['Quote Backlinks']) {
|
||||
@ -3131,7 +3131,7 @@
|
||||
for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
|
||||
quote = _ref2[_i];
|
||||
if (quotedPost = g.posts[quote]) {
|
||||
handleQuotes(quotedPost);
|
||||
handleQuotes(quotedPost, 'backlinks');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -3120,20 +3120,20 @@
|
||||
allQuotelinksLinkingTo: function(post) {
|
||||
var ID, handleQuotes, quote, quotedPost, quotelinks, quoterPost, _i, _len, _ref, _ref1, _ref2;
|
||||
quotelinks = [];
|
||||
handleQuotes = function(post) {
|
||||
handleQuotes = function(post, type) {
|
||||
var clone, _i, _len, _ref;
|
||||
quotelinks.push.apply(quotelinks, post.nodes.quotelinks);
|
||||
quotelinks.push.apply(quotelinks, post.nodes[type]);
|
||||
_ref = post.clones;
|
||||
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
||||
clone = _ref[_i];
|
||||
quotelinks.push.apply(quotelinks, clone.nodes.quotelinks);
|
||||
quotelinks.push.apply(quotelinks, clone.nodes[type]);
|
||||
}
|
||||
};
|
||||
_ref = g.posts;
|
||||
for (ID in _ref) {
|
||||
quoterPost = _ref[ID];
|
||||
if (_ref1 = post.fullID, __indexOf.call(quoterPost.quotes, _ref1) >= 0) {
|
||||
handleQuotes(quoterPost);
|
||||
handleQuotes(quoterPost, 'quotelinks');
|
||||
}
|
||||
}
|
||||
if (Conf['Quote Backlinks']) {
|
||||
@ -3141,7 +3141,7 @@
|
||||
for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
|
||||
quote = _ref2[_i];
|
||||
if (quotedPost = g.posts[quote]) {
|
||||
handleQuotes(quotedPost);
|
||||
handleQuotes(quotedPost, 'backlinks');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -40,23 +40,22 @@ Get =
|
||||
allQuotelinksLinkingTo: (post) ->
|
||||
# Get quotelinks & backlinks linking to the given post.
|
||||
quotelinks = []
|
||||
handleQuotes = (post) ->
|
||||
quotelinks.push post.nodes.quotelinks...
|
||||
for clone in post.clones
|
||||
quotelinks.push clone.nodes.quotelinks...
|
||||
handleQuotes = (post, type) ->
|
||||
quotelinks.push post.nodes[type]...
|
||||
quotelinks.push clone.nodes[type]... for clone in post.clones
|
||||
return
|
||||
# First:
|
||||
# In every posts,
|
||||
# if it did quote this post,
|
||||
# get all their backlinks.
|
||||
handleQuotes quoterPost for ID, quoterPost of g.posts when post.fullID in quoterPost.quotes
|
||||
handleQuotes quoterPost, 'quotelinks' for ID, quoterPost of g.posts when post.fullID in quoterPost.quotes
|
||||
# Second:
|
||||
# If we have quote backlinks:
|
||||
# in all posts this post quoted
|
||||
# and their clones,
|
||||
# get all of their backlinks.
|
||||
if Conf['Quote Backlinks']
|
||||
handleQuotes quotedPost for quote in post.quotes when quotedPost = g.posts[quote]
|
||||
handleQuotes quotedPost, 'backlinks' for quote in post.quotes when quotedPost = g.posts[quote]
|
||||
# Third:
|
||||
# Filter out irrelevant quotelinks.
|
||||
quotelinks.filter (quotelink) ->
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user