Merge "Save dialog: Show reload link next to FancyCaptchas"

This commit is contained in:
jenkins-bot 2015-07-02 22:39:26 +00:00 committed by Gerrit Code Review
commit 9e730bf528
2 changed files with 5 additions and 1 deletions

View file

@ -314,6 +314,7 @@
"spamprotectionmatch",
"spamprotectiontext",
"summary-preview",
"fancycaptcha-reload-text",
"visualeditor-loadwarning",
"visualeditor-loadwarning-token",
"visualeditor-savedialog-identify-anon",

View file

@ -765,12 +765,15 @@ ve.init.mw.ViewPageTarget.prototype.onSaveErrorCaptcha = function ( editApi ) {
document.createTextNode( mw.msg( 'colon-separator' ) )
);
if ( editApi.captcha.url ) { // FancyCaptcha
mw.loader.load( 'ext.confirmEdit.fancyCaptcha' );
$captchaParagraph.append(
$( $.parseHTML( mw.message( 'fancycaptcha-edit' ).parse() ) )
.filter( 'a' ).attr( 'target', '_blank' ).end()
);
$captchaDiv.append(
$( '<img>' ).attr( 'src', editApi.captcha.url )
$( '<img>' ).attr( 'src', editApi.captcha.url ).addClass( 'fancycaptcha-image' ),
' ',
$( '<a>' ).addClass( 'fancycaptcha-reload' ).text( mw.msg( 'fancycaptcha-reload-text' ) )
);
} else if ( editApi.captcha.type === 'simple' || editApi.captcha.type === 'math' ) {
// SimpleCaptcha and MathCaptcha