| 1 | /*! |
| 2 | * VisualEditor Initialization save error handler class |
| 3 | * |
| 4 | * @copyright See AUTHORS.txt |
| 5 | */ |
| 6 | |
| 7 | /** |
| 8 | * Save error handler. |
| 9 | * |
| 10 | * @class |
| 11 | * @abstract |
| 12 | * |
| 13 | * @constructor |
| 14 | */ |
| 15 | ve.init.mw.SaveErrorHandler = function () {}; |
| 16 | |
| 17 | /* Inheritance */ |
| 18 | |
| 19 | OO.initClass( ve.init.mw.SaveErrorHandler ); |
| 20 | |
| 21 | /* Static methods */ |
| 22 | |
| 23 | /** |
| 24 | * Test if this handler should handle a specific API response |
| 25 | * |
| 26 | * @static |
| 27 | * @inheritable |
| 28 | * @param {Object} data API response from action=visualeditoredit |
| 29 | * @return {boolean} |
| 30 | */ |
| 31 | ve.init.mw.SaveErrorHandler.static.matchFunction = null; |
| 32 | |
| 33 | /** |
| 34 | * Process the save error |
| 35 | * |
| 36 | * @static |
| 37 | * @inheritable |
| 38 | * @param {Object} data API response from action=visualeditoredit |
| 39 | * @param {ve.init.mw.ArticleTarget} target |
| 40 | */ |
| 41 | ve.init.mw.SaveErrorHandler.static.process = null; |
| 42 | |
| 43 | /* Save error registry */ |
| 44 | |
| 45 | /* |
| 46 | * Extensions can add SaveErrorHandler sub-classes to this registry. |
| 47 | */ |
| 48 | ve.init.mw.saveErrorHandlerFactory = new OO.Factory(); |