MediaWiki:Common.js: Difference between revisions
No edit summary Tag: Manual revert |
Captcha testing Tag: Reverted |
||
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); | |||
}); | |||
}); |