From 0d8f6c302bcd81dcd1d27c35e3646e09e9edd5d6 Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Tue, 28 Jun 2011 01:32:52 +0200 Subject: [PATCH] Simplify. --- 4chan_x.user.js | 12 ++++-------- script.coffee | 9 ++------- 2 files changed, 6 insertions(+), 15 deletions(-) diff --git a/4chan_x.user.js b/4chan_x.user.js index b77b0799b..68c1e6595 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -1301,9 +1301,7 @@ return $.bind(quote, 'click', qr.cb.quote); }, submit: function(e) { - var form, id, isQR, op; - form = this; - isQR = form.parentNode.id === 'qr'; + var id, op; if ($.config('Auto Watch Reply') && $.config('Thread Watcher')) { if (g.REPLY && $('img.favicon').src === Favicon.empty) { watcher.watch(null, g.THREAD_ID); @@ -1315,12 +1313,10 @@ } } } - if (isQR) { + if (this.id === 'qr_form') { $('#error').textContent = ''; - } - qr.sage = /sage/i.test($('input[name=email]', form).value); - if (isQR) { - return qr.autohide.set(); + qr.autohide.set(); + return qr.sage = /sage/i.test($('input[name=email]', this).value); } }, quote: function(e) { diff --git a/script.coffee b/script.coffee index 5ff3d2b8a..d3dd62ab8 100644 --- a/script.coffee +++ b/script.coffee @@ -1020,9 +1020,6 @@ qr = $.bind quote, 'click', qr.cb.quote submit: (e) -> - form = @ - isQR = form.parentNode.id == 'qr' - if $.config('Auto Watch Reply') and $.config('Thread Watcher') if g.REPLY and $('img.favicon').src is Favicon.empty watcher.watch null, g.THREAD_ID @@ -1032,12 +1029,10 @@ qr = if $('img.favicon', op).src is Favicon.empty watcher.watch op, id - if isQR + if @id is 'qr_form' #Quick Replying $('#error').textContent = '' - - qr.sage = /sage/i.test $('input[name=email]', form).value - if isQR qr.autohide.set() + qr.sage = /sage/i.test $('input[name=email]', @).value quote: (e) -> e.preventDefault()