From 15ffeb27268d9a1628a5268e52082b4ce4a2d079 Mon Sep 17 00:00:00 2001 From: James Campos Date: Mon, 9 May 2011 22:47:41 -0700 Subject: [PATCH] set id outside of loop --- 4chan_x.js | 2 +- script.coffee | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/4chan_x.js b/4chan_x.js index 2b8e52fa7..cdbe68a91 100644 --- a/4chan_x.js +++ b/4chan_x.js @@ -1694,6 +1694,7 @@ }, node: function(root) { var backlink, el, good, id, link, quote, _i, _j, _len, _len2, _ref, _ref2, _results; + id = $('td[id]', root).id; _ref = $$('a.quotelink', root); _results = []; for (_i = 0, _len = _ref.length; _i < _len; _i++) { @@ -1702,7 +1703,6 @@ continue; } good = 1; - id = quote.parentNode.parentNode.parentNode.id; _ref2 = $$('a.backlink', el); for (_j = 0, _len2 = _ref2.length; _j < _len2; _j++) { backlink = _ref2[_j]; diff --git a/script.coffee b/script.coffee index 4a4c775ca..4fdf39755 100644 --- a/script.coffee +++ b/script.coffee @@ -1351,10 +1351,10 @@ quoteBacklink = init: -> g.callbacks.push quoteBacklink.node node: (root) -> + {id} = $ 'td[id]', root for quote in $$ 'a.quotelink', root continue unless el = d.getElementById quote.textContent[2..] good = 1 - id = quote.parentNode.parentNode.parentNode.id for backlink in $$ 'a.backlink', el if backlink.textContent is '>>'+id good = 0