diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js index c453a5587..7212eb2be 100644 --- a/builds/4chan-X.user.js +++ b/builds/4chan-X.user.js @@ -211,7 +211,8 @@ 'Cooldown': [true, 'Indicate the remaining time before posting again.'], 'Cooldown Prediction': [true, 'Decrease the cooldown time by taking into account upload speed. Disable it if it\'s inaccurate for you.'], 'Posting Success Notifications': [true, 'Show notifications on successful post creation or file uploading.'], - 'Captcha Warning Notifications': [true, 'When disabled, shows a red border on the CAPTCHA input until a key is pressed instead of a notification.'] + 'Captcha Warning Notifications': [true, 'When disabled, shows a red border on the CAPTCHA input until a key is pressed instead of a notification.'], + 'Auto-load captcha': [false, 'Automatically load the captcha when you open a thread'] }, 'Quote Links': { 'Quote Backlinks': [true, 'Add quote backlinks.'], @@ -6114,6 +6115,9 @@ if (!(this.isEnabled = !!container)) { return; } + if (Conf['Auto-load captcha']) { + $.globalEval('loadRecaptcha()'); + } imgContainer = $.el('div', { className: 'captcha-img', title: 'Reload reCAPTCHA', diff --git a/builds/crx.crx b/builds/crx.crx index f60dfe9b0..dfadbc5fa 100644 Binary files a/builds/crx.crx and b/builds/crx.crx differ diff --git a/builds/crx/script.js b/builds/crx/script.js index 3f0b43b0d..cdae99ff1 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -189,7 +189,8 @@ 'Cooldown': [true, 'Indicate the remaining time before posting again.'], 'Cooldown Prediction': [true, 'Decrease the cooldown time by taking into account upload speed. Disable it if it\'s inaccurate for you.'], 'Posting Success Notifications': [true, 'Show notifications on successful post creation or file uploading.'], - 'Captcha Warning Notifications': [true, 'When disabled, shows a red border on the CAPTCHA input until a key is pressed instead of a notification.'] + 'Captcha Warning Notifications': [true, 'When disabled, shows a red border on the CAPTCHA input until a key is pressed instead of a notification.'], + 'Auto-load captcha': [false, 'Automatically load the captcha when you open a thread'] }, 'Quote Links': { 'Quote Backlinks': [true, 'Add quote backlinks.'], @@ -6116,6 +6117,9 @@ if (!(this.isEnabled = !!container)) { return; } + if (Conf['Auto-load captcha']) { + $.globalEval('loadRecaptcha()'); + } imgContainer = $.el('div', { className: 'captcha-img', title: 'Reload reCAPTCHA', diff --git a/src/General/Config.coffee b/src/General/Config.coffee index d9691c4ec..4174e94ac 100755 --- a/src/General/Config.coffee +++ b/src/General/Config.coffee @@ -313,6 +313,10 @@ Config = true 'When disabled, shows a red border on the CAPTCHA input until a key is pressed instead of a notification.' ] + 'Auto-load captcha': [ + false + 'Automatically load the captcha when you open a thread' + ] 'Quote Links': 'Quote Backlinks': [ diff --git a/src/Posting/QR.captcha.coffee b/src/Posting/QR.captcha.coffee index 3d821c87b..362fdf4a6 100644 --- a/src/Posting/QR.captcha.coffee +++ b/src/Posting/QR.captcha.coffee @@ -4,6 +4,8 @@ QR.captcha = container = $.id 'captchaContainer' return unless @isEnabled = !!container + $.globalEval 'loadRecaptcha()' if Conf['Auto-load captcha'] + imgContainer = $.el 'div', className: 'captcha-img' title: 'Reload reCAPTCHA'