mediawiki-extensions-TitleB.../modules/ve-titleblacklist/ve.init.mw.TitleBlacklistSaveErrorHandler.js
Bartosz Dziewoński 717820286e ve.init.mw.TitleBlacklistSaveErrorHandler: Disallow retrying
Retrying can never resolve this problem.

Change-Id: I8c0403f994d36cde2003d6b69071459d035fd245
2018-12-07 22:16:37 -05:00

22 lines
881 B
JavaScript

mw.libs.ve.targetLoader.addPlugin( function () {
ve.init.mw.TitleBlacklistSaveErrorHandler = function () {};
OO.inheritClass( ve.init.mw.TitleBlacklistSaveErrorHandler, ve.init.mw.SaveErrorHandler );
ve.init.mw.TitleBlacklistSaveErrorHandler.static.name = 'titleBlacklist';
ve.init.mw.TitleBlacklistSaveErrorHandler.static.matchFunction = function ( data ) {
return ve.getProp( data, 'error', 'code' ) === 'titleblacklist-forbidden';
};
ve.init.mw.TitleBlacklistSaveErrorHandler.static.process = function ( data, target ) {
// Handle warnings/errors from Extension:TitleBlacklist
target.showSaveError( mw.msg( 'visualeditor-saveerror-titleblacklist' ), false );
// Emit event for tracking. TODO: This is a bad design
target.emit( 'saveErrorTitleBlacklist' );
};
ve.init.mw.saveErrorHandlerFactory.register( ve.init.mw.TitleBlacklistSaveErrorHandler );
} );