From e7c77f7cb5f380d3a0a4c72e1d4cae1525cfde1d Mon Sep 17 00:00:00 2001 From: James Campos Date: Fri, 2 Sep 2011 23:18:26 -0700 Subject: [PATCH] parse data, handle mistyped captcha --- 4chan_x.user.js | 5 ++++- script.coffee | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/4chan_x.user.js b/4chan_x.user.js index c38f565da..8746a9d68 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -1404,11 +1404,14 @@ var data, tc, _ref; data = e.data; if (data) { - $.extend($('a.error', QR.el), JSON.parse(data)); + data = JSON.parse(data); + $.extend($('a.error', QR.el), data); tc = data.textContent; if (tc === 'Error: Duplicate file entry detected.') { QR.attachNext(); QR.submit(); + } else if (tc === 'You seem to have mistyped the verification.') { + QR.submit(); } return; } diff --git a/script.coffee b/script.coffee index a96aec0e4..f77feb253 100644 --- a/script.coffee +++ b/script.coffee @@ -1098,11 +1098,14 @@ QR = receive: (e) -> {data} = e if data - $.extend $('a.error', QR.el), JSON.parse data + data = JSON.parse data + $.extend $('a.error', QR.el), data tc = data.textContent if tc is 'Error: Duplicate file entry detected.' QR.attachNext() QR.submit() + else if tc is 'You seem to have mistyped the verification.' + QR.submit() return if conf['Persistent QR'] or $('#files input', QR.el)?.files.length QR.reset()