From 09dd9400b17beefd6d3d4b521d3c51e82be0739a Mon Sep 17 00:00:00 2001 From: Marcel Werk Date: Fri, 12 Jan 2024 13:08:50 +0100 Subject: [PATCH] Set color theme for reCAPTCHA Closes #5721 --- com.woltlab.wcf/templates/recaptcha.tpl | 6 ++++-- wcfsetup/install/files/acp/templates/recaptcha.tpl | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/com.woltlab.wcf/templates/recaptcha.tpl b/com.woltlab.wcf/templates/recaptcha.tpl index 2009016a6a..f2ee95dddf 100644 --- a/com.woltlab.wcf/templates/recaptcha.tpl +++ b/com.woltlab.wcf/templates/recaptcha.tpl @@ -65,7 +65,8 @@ sitekey: '{RECAPTCHA_PUBLICKEY_INVISIBLE|encodeJS}', size: 'invisible', badge: 'inline', - callback: resolve + callback: resolve, + theme: document.documentElement.dataset.colorScheme === "dark" ? "dark" : "light" }); }); @@ -176,7 +177,8 @@ // clear queue while (bucket = WCF.recaptcha.queue.shift()) { WCF.recaptcha.mapping[bucket] = grecaptcha.render(bucket, { - 'sitekey' : '{RECAPTCHA_PUBLICKEY|encodeJS}' + 'sitekey' : '{RECAPTCHA_PUBLICKEY|encodeJS}', + theme: document.documentElement.dataset.colorScheme === "dark" ? "dark" : "light" }); } } diff --git a/wcfsetup/install/files/acp/templates/recaptcha.tpl b/wcfsetup/install/files/acp/templates/recaptcha.tpl index 2009016a6a..f2ee95dddf 100644 --- a/wcfsetup/install/files/acp/templates/recaptcha.tpl +++ b/wcfsetup/install/files/acp/templates/recaptcha.tpl @@ -65,7 +65,8 @@ sitekey: '{RECAPTCHA_PUBLICKEY_INVISIBLE|encodeJS}', size: 'invisible', badge: 'inline', - callback: resolve + callback: resolve, + theme: document.documentElement.dataset.colorScheme === "dark" ? "dark" : "light" }); }); @@ -176,7 +177,8 @@ // clear queue while (bucket = WCF.recaptcha.queue.shift()) { WCF.recaptcha.mapping[bucket] = grecaptcha.render(bucket, { - 'sitekey' : '{RECAPTCHA_PUBLICKEY|encodeJS}' + 'sitekey' : '{RECAPTCHA_PUBLICKEY|encodeJS}', + theme: document.documentElement.dataset.colorScheme === "dark" ? "dark" : "light" }); } } -- 2.20.1