mw.libs.confirmEdit = {}; /** * @class * @extends OO.ui.TextInputWidget * * @constructor * @param {Object} [captchaData] Value of 'captcha' property returned from action=edit API * @param {Object} [config] Configuration options */ mw.libs.confirmEdit.CaptchaInputWidget = function MwWidgetsCaptchaInputWidget( captchaData, config ) { config = config || {}; // Parent constructor mw.libs.confirmEdit.CaptchaInputWidget.parent.call( this, $.extend( { placeholder: mw.msg( 'fancycaptcha-imgcaptcha-ph' ) }, config ) ); // Properties this.$captchaImg = null; this.captchaId = null; // Initialization this.$element.addClass( 'mw-confirmEdit-captchaInputWidget' ); this.$element.prepend( this.makeCaptchaInterface( captchaData ) ); }; /* Setup */ OO.inheritClass( mw.libs.confirmEdit.CaptchaInputWidget, OO.ui.TextInputWidget ); /* Events */ /** * @event load * * A load event is emitted when the CAPTCHA image loads. */ /* Methods */ mw.libs.confirmEdit.CaptchaInputWidget.prototype.makeCaptchaInterface = function ( captchaData ) { var $captchaImg, msg, question, $captchaDiv, $captchaParagraph; $captchaParagraph = $( '