don't backlink op

This commit is contained in:
James Campos 2011-05-12 23:34:05 -07:00
parent 4f15a8d7c1
commit f3d0168f6e
2 changed files with 8 additions and 1 deletions

View File

@ -1678,9 +1678,10 @@
return g.callbacks.push(quoteBacklink.node);
},
node: function(root) {
var el, id, link, qid, quote, quotes, _i, _len, _ref, _results;
var el, id, link, qid, quote, quotes, tid, _i, _len, _ref, _results;
id = root.id || $('td[id]', root).id;
quotes = {};
tid = g.THREAD_ID;
_ref = $$('a.quotelink', root);
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
quote = _ref[_i];
@ -1688,6 +1689,9 @@
continue;
}
qid = qid[0];
if (qid === tid) {
continue;
}
quotes[qid] = quote;
}
_results = [];

View File

@ -1352,9 +1352,12 @@ quoteBacklink =
#better coffee-script way of doing this?
id = root.id or $('td[id]', root).id
quotes = {}
tid = g.THREAD_ID
for quote in $$ 'a.quotelink', root
continue unless qid = quote.textContent.match /\d+/
[qid] = qid
#don't backlink the op
continue if qid == tid
#duplicate quotes get overwritten
quotes[qid] = quote
for qid, quote of quotes