Merge "ve.init.mw.ArticleTarget: Use a simpler error message when site is read-only"

This commit is contained in:
jenkins-bot 2017-04-20 22:34:32 +00:00 committed by Gerrit Code Review
commit 1862f74f11
2 changed files with 4 additions and 5 deletions

View file

@ -381,7 +381,7 @@
"editing",
"lastmodifiedat",
"parentheses",
"readonlywarning",
"apierror-readonly",
"redirectpagesub",
"subject",
"visualeditor-loadwarning",

View file

@ -614,7 +614,7 @@ ve.init.mw.ArticleTarget.prototype.saveFail = function ( doc, saveData, jqXHR, s
this.saveErrorHookAborted();
return;
} else if ( data.error && data.error.code === 'readonly' ) {
this.saveErrorReadOnly( data.error.readonlyreason );
this.saveErrorReadOnly();
return;
}
@ -912,11 +912,10 @@ ve.init.mw.ArticleTarget.prototype.saveErrorPageDeleted = function () {
* Handle read only error
*
* @method
* @param {string} reason The reason given by the system administrator.
* @fires saveErrorReadOnly
*/
ve.init.mw.ArticleTarget.prototype.saveErrorReadOnly = function ( reason ) {
this.showSaveError( $( $.parseHTML( mw.message( 'readonlywarning', reason ).parse() ) ), true, true );
ve.init.mw.ArticleTarget.prototype.saveErrorReadOnly = function () {
this.showSaveError( $( $.parseHTML( mw.message( 'apierror-readonly' ).parse() ) ), true, true );
this.emit( 'saveErrorReadOnly' );
};