From fd141d5dfd37cd8608d515d000d5a6ebe1d07fbd Mon Sep 17 00:00:00 2001 From: James Campos Date: Tue, 10 May 2011 00:26:53 -0700 Subject: [PATCH] x-board previews --- 4chan_x.js | 4 ++-- script.coffee | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/4chan_x.js b/4chan_x.js index cceb2e283..c7ae4ca69 100644 --- a/4chan_x.js +++ b/4chan_x.js @@ -1683,7 +1683,7 @@ _ref = $$('a.quotelink', root); for (_i = 0, _len = _ref.length; _i < _len; _i++) { quote = _ref[_i]; - qid = quote.textContent.slice(2); + qid = quote.textContent.match(/\d+/)[0]; quotes[qid] = quote; } _results = []; @@ -1732,7 +1732,7 @@ }, mouseover: function(e) { var el, id, qp, req, threadID; - id = this.textContent.slice(2); + id = this.textContent.match(/\d+/)[0]; qp = $('#qp'); if (el = d.getElementById(id)) { qp.innerHTML = el.innerHTML; diff --git a/script.coffee b/script.coffee index 0a4d85ed4..e75119466 100644 --- a/script.coffee +++ b/script.coffee @@ -1352,7 +1352,7 @@ quoteBacklink = id = root.id or $('td[id]', root).id quotes = {} for quote in $$ 'a.quotelink', root - qid = quote.textContent[2..] #FIXME cross-board links + qid = quote.textContent.match(/\d+/)[0] #duplicate quotes get overwritten quotes[qid] = quote for qid, quote of quotes @@ -1381,7 +1381,7 @@ quotePreview = $.bind quote, 'mousemove', ui.hover $.bind quote, 'mouseout', ui.hoverend mouseover: (e) -> - id = @textContent[2..] + id = @textContent.match(/\d+/)[0] qp = $ '#qp' if el = d.getElementById id qp.innerHTML = el.innerHTML