mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-26 07:15:32 +00:00
0f05dafa6f
Previously we passed either data.visualeditoredit.edit or data.error, which was mostly okay since they are mutually exclusive, but it could still theoretically conflict if both objects had identical properties (and receiving different things could make debugging errors harder). Change-Id: I818d916275b8451af6910ddaa7cd4d7c653085ee
51 lines
1,020 B
JavaScript
51 lines
1,020 B
JavaScript
/*!
|
|
* VisualEditor Initialization save error handler class
|
|
*
|
|
* @copyright 2011-2018 VisualEditor Team and others; see http://ve.mit-license.org
|
|
*/
|
|
|
|
/**
|
|
* Save error handler.
|
|
*
|
|
* @class
|
|
* @abstract
|
|
*
|
|
* @constructor
|
|
*/
|
|
ve.init.mw.SaveErrorHandler = function () {};
|
|
|
|
/* Inheritance */
|
|
|
|
OO.initClass( ve.init.mw.SaveErrorHandler );
|
|
|
|
/* Static methods */
|
|
|
|
/**
|
|
* Test if this handler should handle a specific API response
|
|
*
|
|
* @static
|
|
* @inheritable
|
|
* @method
|
|
* @param {Object} data API response from action=visualeditoredit
|
|
* @return {boolean}
|
|
*/
|
|
ve.init.mw.SaveErrorHandler.static.matchFunction = null;
|
|
|
|
/**
|
|
* Process the save error
|
|
*
|
|
* @static
|
|
* @inheritable
|
|
* @method
|
|
* @param {Object} data API response from action=visualeditoredit
|
|
* @param {ve.init.mw.ArticleTarget} target Target
|
|
*/
|
|
ve.init.mw.SaveErrorHandler.static.process = null;
|
|
|
|
/* Save error registry */
|
|
|
|
/*
|
|
* Extensions can add SaveErrorHandler sub-classes to this registry.
|
|
*/
|
|
ve.init.mw.saveErrorHandlerFactory = new OO.Factory();
|