From 31a5f5e8a5e784fbeb4ef62c1b0b0e414ad492ee Mon Sep 17 00:00:00 2001 From: James Campos Date: Mon, 30 May 2011 23:01:34 -0700 Subject: [PATCH] Revert "tweak" This reverts commit 686c2ffe1839b6d3d9fabe28cb9be753062bcd02. --- 4chan_x.user.js | 10 +++++----- script.coffee | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/4chan_x.user.js b/4chan_x.user.js index b54e0cc8e..9a43d342c 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -1900,7 +1900,7 @@ } }, mouseover: function(e) { - var el, id, qp, quote, replyID, threadID, _i, _len, _ref; + var el, id, qp, quote, replyID, threadID, _i, _len, _ref, _ref2; this.href = this.getAttribute('data-href'); id = this.hash.slice(1); qp = $('#qp'); @@ -1910,10 +1910,10 @@ $.addClass(el, 'qphl'); } if (this.className === 'backlink') { - replyID = $.x('ancestor::*[@id][1]', this).id.match(/\d+/)[0]; - _ref = $$('a.quotelink', qp); - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - quote = _ref[_i]; + replyID = (_ref = $.x('ancestor::*[@id][1]', this)) != null ? _ref.id.match(/\d+/)[0] : void 0; + _ref2 = $$('a.quotelink', qp); + for (_i = 0, _len = _ref2.length; _i < _len; _i++) { + quote = _ref2[_i]; if (quote.getAttribute('data-href').match(/\d+$/)[0] === replyID) { quote.className = 'forwardlink'; } diff --git a/script.coffee b/script.coffee index 0506ac482..e50f0e3e0 100644 --- a/script.coffee +++ b/script.coffee @@ -1502,7 +1502,7 @@ quotePreview = qp.innerHTML = el.innerHTML $.addClass el, 'qphl' if $.config 'Quote Highlighting' if @className is 'backlink' - replyID = $.x('ancestor::*[@id][1]', @).id.match(/\d+/)[0] + replyID = $.x('ancestor::*[@id][1]', @)?.id.match(/\d+/)[0] for quote in $$ 'a.quotelink', qp if quote.getAttribute('data-href').match(/\d+$/)[0] is replyID quote.className = 'forwardlink'