Fix field placeholder for QuestyCaptcha and others

The message 'fancycaptcha-imgcaptcha-ph' ("Enter the text you see on the image")
should only be used as placeholder for FancyCaptcha.

This affected editors using CaptchaInputWidget in JS, such as VisualEditor
and DiscussionTools.

Change-Id: Ica53b2f3149e9039c95e733e0e89ba62356844e4
This commit is contained in:
Bartosz Dziewoński 2021-01-26 00:14:03 +01:00
parent 51ad178175
commit e7fc8fd290

View file

@ -12,9 +12,7 @@ mw.libs.confirmEdit.CaptchaInputWidget = function MwWidgetsCaptchaInputWidget( c
config = config || {};
// Parent constructor
mw.libs.confirmEdit.CaptchaInputWidget.parent.call( this, $.extend( {
placeholder: mw.msg( 'fancycaptcha-imgcaptcha-ph' )
}, config ) );
mw.libs.confirmEdit.CaptchaInputWidget.parent.call( this, config );
// Properties
this.$captchaImg = null;
@ -52,6 +50,7 @@ mw.libs.confirmEdit.CaptchaInputWidget.prototype.makeCaptchaInterface = function
if ( captchaData.url ) {
// FancyCaptcha
// Based on FancyCaptcha::getFormInformation() and ext.confirmEdit.fancyCaptcha.js
this.$input.attr( 'placeholder', mw.msg( 'fancycaptcha-imgcaptcha-ph' ) );
mw.loader.load( 'ext.confirmEdit.fancyCaptcha' );
$captchaDiv.addClass( 'fancycaptcha-captcha-container' );
$captchaParagraph.append( mw.message( 'fancycaptcha-edit' ).parseDom() );