what is the opposite of pig disgusting?

This commit is contained in:
James Campos 2011-05-09 23:13:02 -07:00
parent 15ffeb2726
commit 8af31eb927
2 changed files with 15 additions and 22 deletions

View File

@ -1693,25 +1693,19 @@
return g.callbacks.push(quoteBacklink.node);
},
node: function(root) {
var backlink, el, good, id, link, quote, _i, _j, _len, _len2, _ref, _ref2, _results;
var el, id, link, qid, quote, quotes, _i, _len, _ref, _results;
id = $('td[id]', root).id;
quotes = {};
_ref = $$('a.quotelink', root);
_results = [];
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
quote = _ref[_i];
if (!(el = d.getElementById(quote.textContent.slice(2)))) {
continue;
}
good = 1;
_ref2 = $$('a.backlink', el);
for (_j = 0, _len2 = _ref2.length; _j < _len2; _j++) {
backlink = _ref2[_j];
if (backlink.textContent === '>>' + id) {
good = 0;
break;
}
}
if (!good) {
qid = quote.textContent.slice(2);
quotes[qid] = quote;
}
_results = [];
for (qid in quotes) {
quote = quotes[qid];
if (!(el = d.getElementById(qid))) {
continue;
}
link = $.el('a', {

View File

@ -1352,14 +1352,13 @@ quoteBacklink =
g.callbacks.push quoteBacklink.node
node: (root) ->
{id} = $ 'td[id]', root
quotes = {}
for quote in $$ 'a.quotelink', root
continue unless el = d.getElementById quote.textContent[2..]
good = 1
for backlink in $$ 'a.backlink', el
if backlink.textContent is '>>'+id
good = 0
break
continue if not good
qid = quote.textContent[2..] #FIXME cross-board links
#duplicate quotes get overwritten
quotes[qid] = quote
for qid, quote of quotes
continue unless el = d.getElementById qid
link = $.el 'a',
href: '#'+id
className: 'backlink'