From 8d5c2821102819b45678ad9a9e858138f022ab70 Mon Sep 17 00:00:00 2001 From: James Campos Date: Sat, 3 Sep 2011 16:04:44 -0700 Subject: [PATCH] refactor --- 4chan_x.user.js | 9 ++------- script.coffee | 7 ++----- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/4chan_x.user.js b/4chan_x.user.js index 2aa85fa41..d0f808f53 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -907,18 +907,13 @@ } }, qr: function(thread, quote) { - var qrLink, tid; - if (!(qrLink = $('td.replyhl span[id] a:not(:first-child)', thread))) { - qrLink = $("span[id^=nothread] a:not(:first-child)", thread); - } - tid = g.THREAD_ID || thread.firstChild.id; if (quote) { - return QR.quote.call(qrLink); + return QR.quote.call($('a.quotejs + a', $('td.replyhl', thread) || thread)); } else { if (QR.qr) { return $('textarea', QR.qr).focus(); } else { - return QR.dialog('', tid); + return QR.dialog('', g.THREAD_ID || thread.firstChild.id); } } }, diff --git a/script.coffee b/script.coffee index 15140d794..753fc1754 100644 --- a/script.coffee +++ b/script.coffee @@ -650,16 +650,13 @@ keybinds = imgExpand.toggle thumb.parentNode qr: (thread, quote) -> - unless qrLink = $ 'td.replyhl span[id] a:not(:first-child)', thread - qrLink = $ "span[id^=nothread] a:not(:first-child)", thread - tid = g.THREAD_ID or thread.firstChild.id if quote - QR.quote.call qrLink + QR.quote.call $ 'a.quotejs + a', $('td.replyhl', thread) or thread else if QR.qr $('textarea', QR.qr).focus() else - QR.dialog '', tid + QR.dialog '', g.THREAD_ID or thread.firstChild.id open: (thread, tab) -> id = thread.firstChild.id