mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-24 22:35:41 +00:00
ArticleTargetSaver: Fix error messages
Follow-up to 5f1c68945d
, which renamed
these messages while moving them into MediaWiki core.
Also, parse HTML in them. This is consistent with real API error
messages, and with the behavior of mw.Api#getErrorMessage. (And also
fixes potential HTML escaping issues.)
Change-Id: I307ca9873e245169a0d4b43499317acbac69fb9b
This commit is contained in:
parent
1a426d8614
commit
6d993fee49
|
@ -341,6 +341,7 @@
|
|||
"dependencies": [
|
||||
"ext.visualEditor.track",
|
||||
"ext.visualEditor.core.utils.parsing",
|
||||
"mediawiki.jqueryMsg",
|
||||
"mediawiki.String",
|
||||
"jquery.textSelection",
|
||||
"mediawiki.api",
|
||||
|
|
|
@ -254,7 +254,7 @@
|
|||
if ( !data ) {
|
||||
error = {
|
||||
code: 'invalidresponse',
|
||||
html: mw.msg( 'visualeditor-error-invalidresponse' )
|
||||
html: mw.message( 'api-clientside-error-invalidresponse' ).parse()
|
||||
};
|
||||
} else if ( data.result !== 'success' ) {
|
||||
// This should only happen when saving an edit and getting a captcha from ConfirmEdit
|
||||
|
@ -268,7 +268,7 @@
|
|||
if ( typeof data.content !== 'string' ) {
|
||||
error = {
|
||||
code: 'invalidcontent',
|
||||
html: mw.msg( 'visualeditor-error-invalidcontent' )
|
||||
html: mw.message( 'api-clientside-error-invalidresponse' ).parse()
|
||||
};
|
||||
}
|
||||
break;
|
||||
|
@ -276,7 +276,7 @@
|
|||
if ( typeof data.diff !== 'string' ) {
|
||||
error = {
|
||||
code: 'invalidcontent',
|
||||
html: mw.msg( 'visualeditor-error-invalidcontent' )
|
||||
html: mw.message( 'api-clientside-error-invalidresponse' ).parse()
|
||||
};
|
||||
}
|
||||
break;
|
||||
|
|
Loading…
Reference in a new issue