diff --git a/templates/main.js b/templates/main.js index d7ae7fae..574a3611 100755 --- a/templates/main.js +++ b/templates/main.js @@ -243,13 +243,13 @@ function getCookie(cookie_name) { {% endraw %} /* BEGIN CAPTCHA REGION */ -{% if config.hcaptcha or config.turnstile %} // If any captcha +{% if config.captcha.mode == 'hcaptcha' or config.captcha.mode == 'turnstile' %} // If any captcha // Global captcha object. Assigned by `onCaptchaLoad()`. var captcha_renderer = null; // Captcha widget id of the post form. var postCaptchaId = null; -{% if config.hcaptcha %} // If hcaptcha +{% if config.captcha.mode == 'hcaptcha' %} // If hcaptcha function onCaptchaLoadHcaptcha() { if (captcha_renderer === null && (active_page === 'index' || active_page === 'catalog' || active_page === 'thread')) { let renderer = { @@ -257,7 +257,7 @@ function onCaptchaLoadHcaptcha() { * @returns {object} Opaque widget id. */ applyOn: (container, params) => hcaptcha.render(container, { - sitekey: "{{ config.hcaptcha_public }}", + sitekey: "{{ config.captcha.hcaptcha.public }}", callback: params['on-success'], }), /** @@ -282,7 +282,7 @@ function onCaptchaLoadHcaptcha() { } } {% endif %} // End if hcaptcha -{% if config.turnstile %} // If turnstile +{% if config.captcha.mode == 'turnstile' %} // If turnstile // Wrapper function to be called from thread.html window.onCaptchaLoadTurnstile_post_reply = function() { @@ -303,7 +303,7 @@ function onCaptchaLoadTurnstile(action) { */ applyOn: function(container, params) { let widgetId = turnstile.render('#' + container, { - sitekey: "{{ config.turnstile_public }}", + sitekey: "{{ config.captcha.turnstile.public }}", action: action, callback: params['on-success'], });