From 81280dd5485c5b3e9a42c49f27a2042bbb0f2afc Mon Sep 17 00:00:00 2001 From: James Campos Date: Sat, 14 May 2011 10:57:26 -0700 Subject: [PATCH] hash[1..] --- 4chan_x.js | 6 ++---- script.coffee | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/4chan_x.js b/4chan_x.js index 6e0015bc8..df5464068 100644 --- a/4chan_x.js +++ b/4chan_x.js @@ -1667,10 +1667,9 @@ _ref = $$('a.quotelink', root); for (_i = 0, _len = _ref.length; _i < _len; _i++) { quote = _ref[_i]; - if (!(qid = quote.textContent.match(/\d+/))) { + if (!(qid = quote.hash.slice(1))) { continue; } - qid = qid[0]; if (qid === tid) { continue; } @@ -1800,10 +1799,9 @@ }, mouseover: function(e) { var el, id, qp, req, threadID; - if (!(id = this.textContent.match(/\d+/))) { + if (!(id = this.hash.slice(1))) { return; } - id = id[0]; qp = $('#qp'); if (el = d.getElementById(id)) { qp.innerHTML = el.innerHTML; diff --git a/script.coffee b/script.coffee index 11b86accf..66f4a9ade 100644 --- a/script.coffee +++ b/script.coffee @@ -1337,8 +1337,7 @@ quoteBacklink = quotes = {} tid = g.THREAD_ID for quote in $$ 'a.quotelink', root - continue unless qid = quote.textContent.match /\d+/ - [qid] = qid + continue unless qid = quote.hash[1..] #don't backlink the op continue if qid == tid #duplicate quotes get overwritten @@ -1424,8 +1423,7 @@ quotePreview = $.bind quote, 'mousemove', ui.hover $.bind quote, 'mouseout', ui.hoverend mouseover: (e) -> - return unless id = @textContent.match /\d+/ - [id] = id + return unless id = @hash[1..] qp = $ '#qp' if el = d.getElementById id qp.innerHTML = el.innerHTML