From bb91393b367a279233689f72fe6cfac832252550 Mon Sep 17 00:00:00 2001 From: ccd0 Date: Sat, 18 Apr 2015 00:36:55 -0700 Subject: [PATCH] Add 'Captcha Fixes' option to turn script in captcha on/off. --- src/General/Config.coffee | 4 ++++ src/General/Main.coffee | 13 +++++++------ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/General/Config.coffee b/src/General/Config.coffee index 3ea4fe6e6..e18322dc0 100755 --- a/src/General/Config.coffee +++ b/src/General/Config.coffee @@ -478,6 +478,10 @@ Config = 'Places a link on the bottom of threads to open the QR.' 1 ] + 'Captcha Fixes': [ + true + 'Make captcha more keyboard-navigable.' + ] 'Quote Links': 'Quote Backlinks': [ diff --git a/src/General/Main.coffee b/src/General/Main.coffee index 7fb4b5bf1..6de834f61 100755 --- a/src/General/Main.coffee +++ b/src/General/Main.coffee @@ -1,12 +1,13 @@ Main = init: -> if location.hostname is 'www.google.com' - return $.ready -> - doc = d.documentElement - if location.pathname is '/recaptcha/api/fallback' - Captcha.noscript.initFrame() - else - Captcha.fixes.init() + if location.pathname is '/recaptcha/api/fallback' + $.ready -> Captcha.noscript.initFrame() + else + $.get 'Captcha Fixes', true, ({'Captcha Fixes': enabled}) -> + if enabled + $.ready -> Captcha.fixes.init() + return g.threads = new SimpleDict() g.posts = new SimpleDict()