2018-12-06 18:27:04 +00:00
|
|
|
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';
|
|
|
|
|
2018-12-07 19:18:30 +00:00
|
|
|
ve.init.mw.TitleBlacklistSaveErrorHandler.static.matchFunction = function ( data ) {
|
|
|
|
return ve.getProp( data, 'error', 'code' ) === 'titleblacklist-forbidden';
|
2018-12-06 18:27:04 +00:00
|
|
|
};
|
|
|
|
|
2018-12-07 19:18:30 +00:00
|
|
|
ve.init.mw.TitleBlacklistSaveErrorHandler.static.process = function ( data, target ) {
|
2018-12-06 18:27:04 +00:00
|
|
|
// Handle warnings/errors from Extension:AbuseFilter
|
|
|
|
target.showSaveError( mw.msg( 'visualeditor-saveerror-titleblacklist' ) );
|
|
|
|
// Emit event for tracking. TODO: This is a bad design
|
|
|
|
target.emit( 'saveErrorTitleBlacklist' );
|
|
|
|
};
|
|
|
|
|
|
|
|
ve.init.mw.saveErrorHandlerFactory.register( ve.init.mw.TitleBlacklistSaveErrorHandler );
|
|
|
|
} );
|