From c2897b5a92491f5c261b7e16618debe1f11dce97 Mon Sep 17 00:00:00 2001 From: Timo Tijhof Date: Wed, 3 Aug 2016 18:25:17 -0700 Subject: [PATCH] mw.ArticleTarget: Fix FancyCaptcha reload button Follows-up 843620632a in ConfirmEdit which now expects a specific class on one of the image parent elements. Without this the refresh link is broken as fancyCapatcha.js is unable to find the image otherwise. Change-Id: Iad7c8e8c77f58092ca4dbb5cbb3527cacff10f03 --- modules/ve-mw/init/ve.init.mw.ArticleTarget.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/ve-mw/init/ve.init.mw.ArticleTarget.js b/modules/ve-mw/init/ve.init.mw.ArticleTarget.js index 92cbca3b42..03dc29f5cb 100644 --- a/modules/ve-mw/init/ve.init.mw.ArticleTarget.js +++ b/modules/ve-mw/init/ve.init.mw.ArticleTarget.js @@ -698,8 +698,12 @@ ve.init.mw.ArticleTarget.prototype.saveErrorCaptcha = function ( editApi ) { $( '' ).text( mw.msg( 'captcha-label' ) ), document.createTextNode( mw.msg( 'colon-separator' ) ) ); - if ( editApi.captcha.url ) { // FancyCaptcha + if ( editApi.captcha.url ) { + // FancyCaptcha + // Based on FancyCaptcha::getFormInformation() (https://git.io/v6mml) and + // ext.confirmEdit.fancyCaptcha.js in the ConfirmEdit extension. mw.loader.load( 'ext.confirmEdit.fancyCaptcha' ); + $captchaDiv.addClass( 'fancycaptcha-captcha-container' ); $captchaParagraph.append( $( $.parseHTML( mw.message( 'fancycaptcha-edit' ).parse() ) ) .filter( 'a' ).attr( 'target', '_blank' ).end()