mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-24 22:35:41 +00:00
Merge "Warn for empty summary when edit section used"
This commit is contained in:
commit
7bef4c9a20
|
@ -927,7 +927,6 @@ ve.init.mw.DesktopArticleTarget.prototype.openSaveDialog = function () {
|
|||
checkboxFields: this.checkboxFields,
|
||||
checkboxesByName: this.checkboxesByName
|
||||
} );
|
||||
this.initialEditSummary = undefined;
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
@ -1195,7 +1195,7 @@ ve.init.mw.ArticleTarget.prototype.startSave = function ( saveDeferred ) {
|
|||
|
||||
if (
|
||||
+mw.user.options.get( 'forceeditsummary' ) &&
|
||||
saveOptions.summary === '' &&
|
||||
( saveOptions.summary === '' || saveOptions.summary === this.initialEditSummary ) &&
|
||||
!this.saveDialog.messages.missingsummary
|
||||
) {
|
||||
this.saveDialog.showMessage(
|
||||
|
|
|
@ -28,6 +28,7 @@ ve.ui.MWSaveDialog = function VeUiMwSaveDialog( config ) {
|
|||
this.setupDeferred = $.Deferred();
|
||||
this.target = null;
|
||||
this.checkboxesByName = null;
|
||||
this.changedEditSummary = false;
|
||||
|
||||
// Initialization
|
||||
this.$element.addClass( 've-ui-mwSaveDialog' );
|
||||
|
@ -382,6 +383,7 @@ ve.ui.MWSaveDialog.prototype.initialize = function () {
|
|||
// Limit byte length, and display the remaining bytes
|
||||
this.editSummaryInput.$input.byteLimit( this.editSummaryByteLimit );
|
||||
this.editSummaryInput.on( 'change', function () {
|
||||
dialog.changedEditSummary = true;
|
||||
// TODO: This looks a bit weird, there is no unit in the UI, just numbers
|
||||
// Users likely assume characters but then it seems to count down quicker
|
||||
// than expected. Facing users with the word "byte" is bad? (bug 40035)
|
||||
|
@ -480,7 +482,7 @@ ve.ui.MWSaveDialog.prototype.getSetupProcess = function ( data ) {
|
|||
return ve.ui.MWSaveDialog.super.prototype.getSetupProcess.call( this, data )
|
||||
.next( function () {
|
||||
this.target = data.target;
|
||||
if ( data.editSummary !== undefined ) {
|
||||
if ( !this.changedEditSummary ) {
|
||||
this.setEditSummary( data.editSummary );
|
||||
}
|
||||
this.setupCheckboxes( data.checkboxFields || [] );
|
||||
|
|
Loading…
Reference in a new issue