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) {
|
allQuotelinksLinkingTo: function(post) {
|
||||||
var ID, handleQuotes, quote, quotedPost, quotelinks, quoterPost, _i, _len, _ref, _ref1, _ref2;
|
var ID, handleQuotes, quote, quotedPost, quotelinks, quoterPost, _i, _len, _ref, _ref1, _ref2;
|
||||||
quotelinks = [];
|
quotelinks = [];
|
||||||
handleQuotes = function(post) {
|
handleQuotes = function(post, type) {
|
||||||
var clone, _i, _len, _ref;
|
var clone, _i, _len, _ref;
|
||||||
quotelinks.push.apply(quotelinks, post.nodes.quotelinks);
|
quotelinks.push.apply(quotelinks, post.nodes[type]);
|
||||||
_ref = post.clones;
|
_ref = post.clones;
|
||||||
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
||||||
clone = _ref[_i];
|
clone = _ref[_i];
|
||||||
quotelinks.push.apply(quotelinks, clone.nodes.quotelinks);
|
quotelinks.push.apply(quotelinks, clone.nodes[type]);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
_ref = g.posts;
|
_ref = g.posts;
|
||||||
for (ID in _ref) {
|
for (ID in _ref) {
|
||||||
quoterPost = _ref[ID];
|
quoterPost = _ref[ID];
|
||||||
if (_ref1 = post.fullID, __indexOf.call(quoterPost.quotes, _ref1) >= 0) {
|
if (_ref1 = post.fullID, __indexOf.call(quoterPost.quotes, _ref1) >= 0) {
|
||||||
handleQuotes(quoterPost);
|
handleQuotes(quoterPost, 'quotelinks');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (Conf['Quote Backlinks']) {
|
if (Conf['Quote Backlinks']) {
|
||||||
@ -3131,7 +3131,7 @@
|
|||||||
for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
|
for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
|
||||||
quote = _ref2[_i];
|
quote = _ref2[_i];
|
||||||
if (quotedPost = g.posts[quote]) {
|
if (quotedPost = g.posts[quote]) {
|
||||||
handleQuotes(quotedPost);
|
handleQuotes(quotedPost, 'backlinks');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3120,20 +3120,20 @@
|
|||||||
allQuotelinksLinkingTo: function(post) {
|
allQuotelinksLinkingTo: function(post) {
|
||||||
var ID, handleQuotes, quote, quotedPost, quotelinks, quoterPost, _i, _len, _ref, _ref1, _ref2;
|
var ID, handleQuotes, quote, quotedPost, quotelinks, quoterPost, _i, _len, _ref, _ref1, _ref2;
|
||||||
quotelinks = [];
|
quotelinks = [];
|
||||||
handleQuotes = function(post) {
|
handleQuotes = function(post, type) {
|
||||||
var clone, _i, _len, _ref;
|
var clone, _i, _len, _ref;
|
||||||
quotelinks.push.apply(quotelinks, post.nodes.quotelinks);
|
quotelinks.push.apply(quotelinks, post.nodes[type]);
|
||||||
_ref = post.clones;
|
_ref = post.clones;
|
||||||
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
||||||
clone = _ref[_i];
|
clone = _ref[_i];
|
||||||
quotelinks.push.apply(quotelinks, clone.nodes.quotelinks);
|
quotelinks.push.apply(quotelinks, clone.nodes[type]);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
_ref = g.posts;
|
_ref = g.posts;
|
||||||
for (ID in _ref) {
|
for (ID in _ref) {
|
||||||
quoterPost = _ref[ID];
|
quoterPost = _ref[ID];
|
||||||
if (_ref1 = post.fullID, __indexOf.call(quoterPost.quotes, _ref1) >= 0) {
|
if (_ref1 = post.fullID, __indexOf.call(quoterPost.quotes, _ref1) >= 0) {
|
||||||
handleQuotes(quoterPost);
|
handleQuotes(quoterPost, 'quotelinks');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (Conf['Quote Backlinks']) {
|
if (Conf['Quote Backlinks']) {
|
||||||
@ -3141,7 +3141,7 @@
|
|||||||
for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
|
for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
|
||||||
quote = _ref2[_i];
|
quote = _ref2[_i];
|
||||||
if (quotedPost = g.posts[quote]) {
|
if (quotedPost = g.posts[quote]) {
|
||||||
handleQuotes(quotedPost);
|
handleQuotes(quotedPost, 'backlinks');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -40,23 +40,22 @@ Get =
|
|||||||
allQuotelinksLinkingTo: (post) ->
|
allQuotelinksLinkingTo: (post) ->
|
||||||
# Get quotelinks & backlinks linking to the given post.
|
# Get quotelinks & backlinks linking to the given post.
|
||||||
quotelinks = []
|
quotelinks = []
|
||||||
handleQuotes = (post) ->
|
handleQuotes = (post, type) ->
|
||||||
quotelinks.push post.nodes.quotelinks...
|
quotelinks.push post.nodes[type]...
|
||||||
for clone in post.clones
|
quotelinks.push clone.nodes[type]... for clone in post.clones
|
||||||
quotelinks.push clone.nodes.quotelinks...
|
|
||||||
return
|
return
|
||||||
# First:
|
# First:
|
||||||
# In every posts,
|
# In every posts,
|
||||||
# if it did quote this post,
|
# if it did quote this post,
|
||||||
# get all their backlinks.
|
# 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:
|
# Second:
|
||||||
# If we have quote backlinks:
|
# If we have quote backlinks:
|
||||||
# in all posts this post quoted
|
# in all posts this post quoted
|
||||||
# and their clones,
|
# and their clones,
|
||||||
# get all of their backlinks.
|
# get all of their backlinks.
|
||||||
if Conf['Quote 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:
|
# Third:
|
||||||
# Filter out irrelevant quotelinks.
|
# Filter out irrelevant quotelinks.
|
||||||
quotelinks.filter (quotelink) ->
|
quotelinks.filter (quotelink) ->
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user