MediaWiki:Common.js: Difference between revisions

Captcha testing
Tag: Reverted
No edit summary
Tag: Manual revert
 
(5 intermediate revisions by the same user not shown)
Line 107: Line 107:
   }
   }
}
}
mw.loader.using('mediawiki.util', function () {
    $(document).on('focus', '.ext-discussiontools-init-replyLink', function () {
        setTimeout(function () {
            if (!$('#custom-hcaptcha').length) {
                const hCaptchaDiv = $('<div>', {
                    id: 'custom-hcaptcha',
                    class: 'h-captcha',
                    'data-sitekey': 'YOUR_SITE_KEY' // ← Replace this
                });
                $('.ext-discussiontools-ui-replyWidget-captcha').html(hCaptchaDiv);
                const script = document.createElement('script');
                script.src = 'https://js.hcaptcha.com/1/api.js';
                script.async = true;
                script.defer = true;
                document.body.appendChild(script);
            }
        }, 500);
    });
});