From 2ba7ae5d280c7f5c8c0ef803f99fcdd0606e7270 Mon Sep 17 00:00:00 2001 From: Zixaphir Date: Sat, 5 Apr 2014 00:58:57 -0700 Subject: [PATCH 1/2] I like that better --- builds/4chan-X.user.js | 7 +++---- builds/crx/script.js | 7 +++---- src/Posting/QR.coffee | 3 --- src/Posting/QR.post.coffee | 2 ++ 4 files changed, 8 insertions(+), 11 deletions(-) diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js index f940b50e0..e1aedac33 100644 --- a/builds/4chan-X.user.js +++ b/builds/4chan-X.user.js @@ -6804,10 +6804,6 @@ if (!(Conf['Persistent QR'] || QR.cooldown.auto)) { QR.close(); } else { - if (QR.posts.length > 1) { - QR.captcha.setup(); - QR.captcha.afterSetup(); - } post.rm(); } QR.cooldown.set({ @@ -7249,6 +7245,9 @@ $.rmClass(QR.nodes.el, 'dump'); } else if (this === QR.selected) { (QR.posts[index - 1] || QR.posts[index + 1]).select(); + if (QR.captcha.isEnabled) { + QR.captcha.setup(); + } } QR.posts.splice(index, 1); return QR.status(); diff --git a/builds/crx/script.js b/builds/crx/script.js index 4caa60bd8..b12bbbbcf 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -6849,10 +6849,6 @@ if (!(Conf['Persistent QR'] || QR.cooldown.auto)) { QR.close(); } else { - if (QR.posts.length > 1) { - QR.captcha.setup(); - QR.captcha.afterSetup(); - } post.rm(); } QR.cooldown.set({ @@ -7288,6 +7284,9 @@ $.rmClass(QR.nodes.el, 'dump'); } else if (this === QR.selected) { (QR.posts[index - 1] || QR.posts[index + 1]).select(); + if (QR.captcha.isEnabled) { + QR.captcha.setup(); + } } QR.posts.splice(index, 1); return QR.status(); diff --git a/src/Posting/QR.coffee b/src/Posting/QR.coffee index ec898a265..558eb0a57 100644 --- a/src/Posting/QR.coffee +++ b/src/Posting/QR.coffee @@ -791,9 +791,6 @@ QR = unless Conf['Persistent QR'] or QR.cooldown.auto QR.close() else - if QR.posts.length > 1 - QR.captcha.setup() - QR.captcha.afterSetup() post.rm() QR.cooldown.set {req, post, isReply, threadID} diff --git a/src/Posting/QR.post.coffee b/src/Posting/QR.post.coffee index 6e6daa84a..0e2d2d320 100644 --- a/src/Posting/QR.post.coffee +++ b/src/Posting/QR.post.coffee @@ -80,6 +80,8 @@ QR.post = class $.rmClass QR.nodes.el, 'dump' else if @ is QR.selected (QR.posts[index-1] or QR.posts[index+1]).select() + if QR.captcha.isEnabled + QR.captcha.setup() QR.posts.splice index, 1 QR.status() delete: -> From df78c2e1f824ecb1490bf8e91bc6e1523aecc7cc Mon Sep 17 00:00:00 2001 From: Zixaphir Date: Sat, 5 Apr 2014 01:02:43 -0700 Subject: [PATCH 2/2] Handle captcha errors with a new captcha! --- builds/4chan-X.user.js | 1 + builds/crx/script.js | 1 + src/Posting/QR.coffee | 1 + 3 files changed, 3 insertions(+) diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js index e1aedac33..91328acdd 100644 --- a/builds/4chan-X.user.js +++ b/builds/4chan-X.user.js @@ -6123,6 +6123,7 @@ } if (QR.captcha.isEnabled && /captcha|verification/i.test(el.textContent)) { QR.captcha.nodes.input.focus(); + QR.captcha.setup(); if (Conf['Captcha Warning Notifications'] && !d.hidden) { QR.notify(el); } else { diff --git a/builds/crx/script.js b/builds/crx/script.js index b12bbbbcf..d29c43881 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -6178,6 +6178,7 @@ } if (QR.captcha.isEnabled && /captcha|verification/i.test(el.textContent)) { QR.captcha.nodes.input.focus(); + QR.captcha.setup(); if (Conf['Captcha Warning Notifications'] && !d.hidden) { QR.notify(el); } else { diff --git a/src/Posting/QR.coffee b/src/Posting/QR.coffee index 558eb0a57..1e74ee756 100644 --- a/src/Posting/QR.coffee +++ b/src/Posting/QR.coffee @@ -144,6 +144,7 @@ QR = if QR.captcha.isEnabled and /captcha|verification/i.test el.textContent # Focus the captcha input on captcha error. QR.captcha.nodes.input.focus() + QR.captcha.setup() if Conf['Captcha Warning Notifications'] and !d.hidden QR.notify el else