mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-13 17:48:17 +00:00
Merge "ve.ui.MWEditSummaryWidget: Use built-in 'allowLinebreaks' option"
This commit is contained in:
commit
aac7f99742
|
@ -24,7 +24,7 @@
|
||||||
"license-name": "MIT",
|
"license-name": "MIT",
|
||||||
"type": "editor",
|
"type": "editor",
|
||||||
"requires": {
|
"requires": {
|
||||||
"MediaWiki": ">= 1.41"
|
"MediaWiki": ">= 1.42"
|
||||||
},
|
},
|
||||||
"callback": "MediaWiki\\Extension\\VisualEditor\\Hooks::onRegistration",
|
"callback": "MediaWiki\\Extension\\VisualEditor\\Hooks::onRegistration",
|
||||||
"ServiceWiringFiles": [
|
"ServiceWiringFiles": [
|
||||||
|
|
|
@ -23,10 +23,7 @@ ve.ui.MWEditSummaryWidget = function VeUiMWEditSummaryWidget( config ) {
|
||||||
ve.ui.MWEditSummaryWidget.super.call( this, ve.extendObject( {
|
ve.ui.MWEditSummaryWidget.super.call( this, ve.extendObject( {
|
||||||
autosize: true,
|
autosize: true,
|
||||||
maxRows: 15,
|
maxRows: 15,
|
||||||
inputFilter: function ( value ) {
|
allowLinebreaks: false
|
||||||
// Prevent the user from inputting newlines (this kicks in on paste, etc.)
|
|
||||||
return value.replace( /\r?\n/g, ' ' );
|
|
||||||
}
|
|
||||||
}, config ) );
|
}, config ) );
|
||||||
|
|
||||||
// Mixin method
|
// Mixin method
|
||||||
|
@ -131,19 +128,6 @@ ve.ui.MWEditSummaryWidget.prototype.adjustSize = function () {
|
||||||
return this;
|
return this;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
|
||||||
* @inheritdoc
|
|
||||||
*/
|
|
||||||
ve.ui.MWEditSummaryWidget.prototype.onKeyPress = function ( e ) {
|
|
||||||
if ( e.which === OO.ui.Keys.ENTER ) {
|
|
||||||
e.preventDefault();
|
|
||||||
}
|
|
||||||
// Grand-parent method
|
|
||||||
// Multi-line only fires 'enter' on ctrl+enter, but this should
|
|
||||||
// fire on plain enter as it behaves like a single line input.
|
|
||||||
OO.ui.TextInputWidget.prototype.onKeyPress.call( this, e );
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get recent edit summaries for the logged in user
|
* Get recent edit summaries for the logged in user
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in a new issue