Drop support for wgCommentByteLimit, hard-coded null in MW nowadays

Change-Id: I767e0633415568134c46fccbafdaceb1ab76dea3
This commit is contained in:
James D. Forrester 2020-08-26 20:08:15 +01:00 committed by Esanders
parent 9e12aa1d0c
commit 8a78603988
4 changed files with 6 additions and 23 deletions

View file

@ -778,7 +778,6 @@
"visualeditor-diff-no-changes",
"visualeditor-editconflict",
"visualeditor-editsummary",
"visualeditor-editsummary-bytes-remaining",
"visualeditor-editsummary-characters-remaining",
"visualeditor-serializeerror",
"visualeditor-savedialog-error-badtoken",

View file

@ -211,7 +211,6 @@
"visualeditor-editnotices-tool": "$1 {{PLURAL:$1|notice|notices}}",
"visualeditor-editnotices-tooltip": "Edit notices",
"visualeditor-editsummary": "Describe what you changed",
"visualeditor-editsummary-bytes-remaining": "The number of bytes remaining",
"visualeditor-editsummary-characters-remaining": "The number of characters remaining",
"visualeditor-educationpopup-dismiss": "Okay, got it",
"visualeditor-feedback-defaultmessage": "URL: $1",

View file

@ -229,7 +229,6 @@
"visualeditor-editnotices-tool": "Text of tool in the toolbar that shows edit notices (such as [[MediaWiki:Editnotice-0]] and [[MediaWiki:Editnotice-8/en]]) as a pop-up.\n\nParameters:\n* $1 - the number of notices\n{{Identical|Notice}}",
"visualeditor-editnotices-tooltip": "Text of tooltip for the tool in the toolbar that shows edit notices (i.e. “messages about the editing”), e.g. the “you are not currently logged in” notice",
"visualeditor-editsummary": "Label for the edit summary box",
"visualeditor-editsummary-bytes-remaining": "Tooltip for the number of bytes remaining in the edit summary",
"visualeditor-editsummary-characters-remaining": "Tooltip for the number of characters remaining in the edit summary",
"visualeditor-educationpopup-dismiss": "Text on dismiss button shown on the educational popups drawing user attention to specific tools.",
"visualeditor-feedback-defaultmessage": "Default message text for the feedback dialog.\nParameters:\n\n* $1 - URL of the page\n{{Identical|URL}}",

View file

@ -22,7 +22,6 @@ ve.ui.MWSaveDialog = function VeUiMwSaveDialog( config ) {
ve.ui.MWSaveDialog.super.call( this, config );
// Properties
this.editSummaryByteLimit = mw.config.get( 'wgCommentByteLimit' );
this.editSummaryCodePointLimit = mw.config.get( 'wgCommentCodePointLimit' );
this.restoring = false;
this.messages = {};
@ -593,12 +592,11 @@ ve.ui.MWSaveDialog.prototype.initialize = function () {
classes: [ 've-ui-mwSaveDialog-savePanel' ]
} );
// Byte counter in edit summary
// Character counter in edit summary
this.editSummaryCountLabel = new OO.ui.LabelWidget( {
classes: [ 've-ui-mwSaveDialog-editSummary-count' ],
label: '',
title: ve.msg( this.editSummaryCodePointLimit ?
'visualeditor-editsummary-characters-remaining' : 'visualeditor-editsummary-bytes-remaining' )
title: ve.msg( 'visualeditor-editsummary-characters-remaining' )
} );
// Save panel
@ -629,23 +627,11 @@ ve.ui.MWSaveDialog.prototype.initialize = function () {
);
}
} );
// Limit length, and display the remaining bytes/characters
if ( this.editSummaryCodePointLimit ) {
this.editSummaryInput.$input.codePointLimit( this.editSummaryCodePointLimit );
} else {
this.editSummaryInput.$input.byteLimit( this.editSummaryByteLimit );
}
// Limit length, and display the remaining characters
this.editSummaryInput.$input.codePointLimit( this.editSummaryCodePointLimit );
this.editSummaryInput.on( 'change', function () {
var remaining;
if ( dialog.editSummaryCodePointLimit ) {
remaining = dialog.editSummaryCodePointLimit - mwString.codePointLength( dialog.editSummaryInput.getValue() );
} else {
remaining = dialog.editSummaryByteLimit - mwString.byteLength( dialog.editSummaryInput.getValue() );
}
// 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 if it's byteLimit. Facing users with the
// word "byte" is bad? (T42035)
var remaining = dialog.editSummaryCodePointLimit - mwString.codePointLength( dialog.editSummaryInput.getValue() );
// TODO: This looks a bit weird, there is no unit in the UI, just numbers.
dialog.changedEditSummary = true;
if ( remaining > 99 ) {
dialog.editSummaryCountLabel.setLabel( '' );