From 1dfa1df3b0724af2f78c0bf256d28d9ea270d1d8 Mon Sep 17 00:00:00 2001 From: ccd0 Date: Mon, 25 Jan 2016 19:48:40 -0800 Subject: [PATCH] Show dark theme captcha if the document has the class `dark-captcha`. --- src/Posting/Captcha.v2.coffee | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Posting/Captcha.v2.coffee b/src/Posting/Captcha.v2.coffee index b97166af6..326f888ab 100644 --- a/src/Posting/Captcha.v2.coffee +++ b/src/Posting/Captcha.v2.coffee @@ -105,10 +105,11 @@ Captcha.v2 = setupJS: -> $.global -> render = -> + {classList} = document.documentElement container = document.querySelector '#qr .captcha-container' container.dataset.widgetID = window.grecaptcha.render container, sitekey: '<%= meta.recaptchaKey %>' - theme: if document.documentElement.classList.contains('tomorrow') then 'dark' else 'light' + theme: if classList.contains('tomorrow') or classList.contains('dark-captcha') then 'dark' else 'light' callback: (response) -> window.dispatchEvent new CustomEvent('captcha:success', {detail: response}) if window.grecaptcha