From 986cf60ec6d94574bf348e79b61ee71f376d1441 Mon Sep 17 00:00:00 2001 From: James Campos Date: Wed, 10 Nov 2010 02:03:24 -0800 Subject: [PATCH] add backspace recaptcha refreshing to reports --- 4chan_x.coffee | 15 ++++++++------- 4chan_x.js | 6 +++++- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/4chan_x.coffee b/4chan_x.coffee index 42af2b59e..4f28c2638 100644 --- a/4chan_x.coffee +++ b/4chan_x.coffee @@ -604,13 +604,15 @@ watchX = -> favicon = input.previousSibling favicon.src = favEmpty -#let's get this party started. +#main watched = JSON.parse(GM_getValue('watched', '{}')) if location.hostname.split('.')[0] is 'sys' - if b = $('table font b') - GM_setValue('error', b.firstChild.textContent) + if recaptcha = $ '#recaptcha_response_field' + m recaptcha, listener: ['keydown', recaptchaListener] + else if b = $ 'table font b' + GM_setValue 'error', b.firstChild.textContent else - GM_setValue('error', '') + GM_setValue 'error', '' if getConfig 'Auto Watch' html = $('b').innerHTML [_, thread, id] = html.match(//) @@ -619,9 +621,9 @@ if location.hostname.split('.')[0] is 'sys' watched[board] or= [] watched[board].push { id: id, - text: GM_getValue('autoText') + text: GM_getValue 'autoText' } - GM_setValue('watched', JSON.stringify(watched)) + GM_setValue 'watched', JSON.stringify watched return pathname = location.pathname.substring(1).split('/') @@ -724,7 +726,6 @@ GM_addStyle(' } ') -#main part 2... AEOS.init() if navtopr = $ '#navtopr a' text = navtopr.nextSibling #css doesn't see text nodes diff --git a/4chan_x.js b/4chan_x.js index 8b333dbec..a06a64086 100644 --- a/4chan_x.js +++ b/4chan_x.js @@ -777,7 +777,11 @@ }; watched = JSON.parse(GM_getValue('watched', '{}')); if (location.hostname.split('.')[0] === 'sys') { - if (b = $('table font b')) { + if (recaptcha = $('#recaptcha_response_field')) { + m(recaptcha, { + listener: ['keydown', recaptchaListener] + }); + } else if (b = $('table font b')) { GM_setValue('error', b.firstChild.textContent); } else { GM_setValue('error', '');