forked from leftypol/leftypol
main.js: use new config style
This commit is contained in:
parent
4eb12479ec
commit
a70b6e6ec9
1 changed files with 5 additions and 5 deletions
|
@ -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'],
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue