Remove dead code in MWTemplatePage

Bug: T310859
Change-Id: Ie55d82fb6f3be0b90b8f42aecdd761624b94afca
This commit is contained in:
WMDE-Fisch 2022-06-21 12:30:42 +02:00 committed by DannyS712
parent 3b9e0bf0dc
commit 11f5f6cb59
6 changed files with 4 additions and 55 deletions

View file

@ -2177,9 +2177,7 @@
"visualeditor-changedesc-mwtransclusion",
"visualeditor-dialog-template-insert",
"visualeditor-dialog-template-title",
"visualeditor-dialog-transclusion-absent-template",
"visualeditor-dialog-transclusion-action-save",
"visualeditor-dialog-transclusion-add-param",
"visualeditor-dialog-transclusion-add-param-error-alias",
"visualeditor-dialog-transclusion-add-param-error-deprecated",
"visualeditor-dialog-transclusion-add-param-error-exists-selected",
@ -2211,7 +2209,6 @@
"visualeditor-dialog-transclusion-help-page-help",
"visualeditor-dialog-transclusion-help-page-shortcuts",
"visualeditor-dialog-transclusion-loading",
"visualeditor-dialog-transclusion-more-template-description",
"visualeditor-dialog-transclusion-multipart-message",
"visualeditor-dialog-transclusion-no-template-data-description",
"visualeditor-dialog-transclusion-no-template-description",

View file

@ -164,14 +164,12 @@
"visualeditor-dialog-template-insert": "Insert a template",
"visualeditor-dialog-template-title": "Template",
"visualeditor-dialog-transclusion-action-save": "Save",
"visualeditor-dialog-transclusion-absent-template": "The \"$1\" template doesn't yet exist.",
"visualeditor-dialog-transclusion-template-title-nonexistent": "This template doesn't exist.",
"visualeditor-dialog-transclusion-template-title-modifier": "Template documentation and [//www.mediawiki.org/wiki/Special:MyLanguage/Manual:Glossary#Parameter parameter] names (if existing) are not available when editing templates utilizing nested syntax or modifiers, such as [//www.mediawiki.org/wiki/Special:MyLanguage/Help:Substitution subst].",
"visualeditor-dialog-transclusion-template-widget-aria": "Press Space to select the template.",
"visualeditor-dialog-transclusion-template-widget-aria-selected": "Press Ctrl+Del to delete the template, its parameters and their values. Press Ctrl+Shift+Arrows to move the template up or down.",
"visualeditor-dialog-transclusion-template-widget-aria-selected-single": "Press Ctrl+Del to delete the template, its parameters and their values.",
"visualeditor-dialog-transclusion-add-wikitext": "Add wikitext",
"visualeditor-dialog-transclusion-add-param": "Add more information",
"visualeditor-dialog-transclusion-add-param-error-alias": "\"$1\" is already added as \"$2\". Please check the options in the sidebar. This is due to either the use of [//www.mediawiki.org/wiki/Special:MyLanguage/Help:TemplateData#aliases aliases] or [//www.mediawiki.org/wiki/Special:MyLanguage/Help:TemplateData#label labels].",
"visualeditor-dialog-transclusion-add-param-error-deprecated": "\"$1\" cannot be added because the parameter has been marked as [//www.mediawiki.org/wiki/Special:MyLanguage/Help:TemplateData#deprecated deprecated].",
"visualeditor-dialog-transclusion-add-param-error-exists-selected": "Cannot add the parameter \"$2\" twice.",
@ -202,7 +200,6 @@
"visualeditor-dialog-transclusion-deprecated-parameter": "Deprecated field",
"visualeditor-dialog-transclusion-deprecated-parameter-description": "Field is deprecated. $1",
"visualeditor-dialog-transclusion-loading": "Loading...",
"visualeditor-dialog-transclusion-more-template-description": "There might be some additional information about the \"$1\" template on [[$2|its page]].",
"visualeditor-dialog-transclusion-multipart-message": "You are currently editing a template and one or more pieces of [//www.mediawiki.org/wiki/Special:MyLanguage/Help:VisualEditor/User_guide#Editing_multi-part_template_content connected content] (wikitext and/or additional templates).",
"visualeditor-dialog-transclusion-no-template-data-description": "This template is missing [//www.mediawiki.org/wiki/Special:MyLanguage/Help:VisualEditor/User_guide#Template_parameters TemplateData], and its parameters have been [//www.mediawiki.org/wiki/Special:MyLanguage/Help:VisualEditor/User_guide#Autogenerated_parameters autogenerated]. As a result the template and its parameters lack descriptions. There might be additional information on the [[$1|template's page]].",
"visualeditor-dialog-transclusion-no-template-description": "The \"$1\" template doesn't yet have a description, but there might be some information on the [[$2|template's page]].",

View file

@ -184,14 +184,12 @@
"visualeditor-dialog-template-insert": "Title for the template dialog to insert a new template.",
"visualeditor-dialog-template-title": "{{Identical|Template}}",
"visualeditor-dialog-transclusion-action-save": "Label for button that saves changes when editing an existing transclusion in the transclusion dialog.",
"visualeditor-dialog-transclusion-absent-template": "Message to user that the template they have selected does not exist on this wiki.\n\nParameters:\n* $1 - Human-readable name of the template.\n* $2 - Full page name of the template.",
"visualeditor-dialog-transclusion-template-title-nonexistent": "Message to user that the template name they have provided does not exist on this wiki.\n\nParameters:\n* $1 - Human-readable name of the template.\n* $2 - Full page name of the template.",
"visualeditor-dialog-transclusion-template-title-modifier": "Message to user that the template name they have provided contains wikitext syntax or modifiers that can't be resolved.\n\nParameters:\n* $1 - Human-readable name of the template.\n* $2 - Full page name of the template.",
"visualeditor-dialog-transclusion-template-widget-aria": "ARIA description for screen readers on the template parameter selection menu for the keyboard controls on unselected template parts.",
"visualeditor-dialog-transclusion-template-widget-aria-selected": "ARIA description for screen readers on the template parameter selection menu for the keyboard controls on selected template parts.",
"visualeditor-dialog-transclusion-template-widget-aria-selected-single": "ARIA description for screen readers on the template parameter selection menu for the keyboard controls on selected template parts that can't be moved.",
"visualeditor-dialog-transclusion-add-wikitext": "Label for button that adds parameter wikitext to a transclusion.",
"visualeditor-dialog-transclusion-add-param": "Label for button that adds a parameter to a transcluded template.",
"visualeditor-dialog-transclusion-add-param-error-alias": "Message shown to an editor when they attempt adding an alias of a another parameter already present in the sidebar.\n\nParameters:\n* $1 - The alias as entered by the user.\n* $2 - The label of the parameter as shown in the sidebar.\n\n\"Alias\" must be translated using the same word as in this message: {{msg-mw|Templatedata-modal-table-param-aliases}}",
"visualeditor-dialog-transclusion-add-param-error-deprecated": "Message shown to an editor when they attempt adding a parameter which is deprecated.\n\nParameters:\n* $1 - The parameter name as entered by the user.\n* $2 - The label of the parameter as shown in the sidebar.\n\n\"Deprecated\" should be translated using the same word as in this message: {{msg-mw|Templatedata-doc-param-status-deprecated}}",
"visualeditor-dialog-transclusion-add-param-error-exists-selected": "Message shown to an editor when they attempt adding a parameter which is already present and checked in the sidebar.\n\nParameters:\n* $1 - The parameter name as entered by the user.\n* $2 - The label of the parameter as shown in the sidebar.",
@ -222,7 +220,6 @@
"visualeditor-dialog-transclusion-deprecated-parameter": "Tooltip for the indicator icon (an exclamation mark) that marks deprecated template parameters.",
"visualeditor-dialog-transclusion-deprecated-parameter-description": "Label describing that a template parameter is deprecated and should not be used any more.\n\nParameters:\n* $1 - Description given in the template's TemplateData documentation for why the parameter is deprecated. May be empty.",
"visualeditor-dialog-transclusion-loading": "Title for the transclusion dialog while its contents are loading.\n{{Identical|Loading}}",
"visualeditor-dialog-transclusion-more-template-description": "Message to user that additional template information might be available for a template.\n\nParameters:\n* $1 - Human-readable name of the template.\n* $2 - Full page name of the template.",
"visualeditor-dialog-transclusion-multipart-message": "Message displayed when a transclusion with multiple parts is edited.",
"visualeditor-dialog-transclusion-no-template-data-description": "Message to user that no information on the template's parameters is available for the template.\n\nParameters:\n* $1 - The title of the template.",
"visualeditor-dialog-transclusion-no-template-description": "Message to user that no template information is available for the template.\n\nParameters:\n* $1 - Human-readable name of the template.\n* $2 - Full page name of the template.",

View file

@ -19,8 +19,7 @@
* @cfg {boolean} [isReadOnly] Page is read-only
*/
ve.ui.MWTemplatePage = function VeUiMWTemplatePage( template, name, config ) {
var link = template.getTemplateDataQueryTitle(),
veConfig = mw.config.get( 'wgVisualEditorConfig' );
var link = template.getTemplateDataQueryTitle();
// Configuration initialization
config = ve.extendObject( {
@ -55,19 +54,10 @@ ve.ui.MWTemplatePage = function VeUiMWTemplatePage( template, name, config ) {
messageStyle = 've-ui-mwTemplatePage-description-missing',
$addMessageHere = this.$description;
if ( this.spec.getDescription() ) {
key = !veConfig.transclusionDialogNewSidebar ?
'visualeditor-dialog-transclusion-more-template-description' :
'visualeditor-dialog-transclusion-see-template';
key = 'visualeditor-dialog-transclusion-see-template';
messageStyle = 've-ui-mwTemplatePage-description-extra';
$addMessageHere = $( '<span>' );
this.$description.append( $( '<hr>' ), $addMessageHere );
} else if ( !veConfig.transclusionDialogNewSidebar ) {
if ( knownAsMissing ) {
key = 'visualeditor-dialog-transclusion-absent-template';
} else if ( link ) {
key = 'visualeditor-dialog-transclusion-no-template-description';
}
// Note this leaves dynamic template names like {{ {{foo}} }} without a message.
} else if ( !link || knownAsMissing ) {
var title;
try {
@ -84,8 +74,6 @@ ve.ui.MWTemplatePage = function VeUiMWTemplatePage( template, name, config ) {
if ( key ) {
// The following messages are used here:
// * visualeditor-dialog-transclusion-absent-template
// * visualeditor-dialog-transclusion-more-template-description
// * visualeditor-dialog-transclusion-no-template-description
// * visualeditor-dialog-transclusion-see-template
// * visualeditor-dialog-transclusion-template-title-modifier
@ -106,7 +94,7 @@ ve.ui.MWTemplatePage = function VeUiMWTemplatePage( template, name, config ) {
this.infoFieldset.$element
.append( this.$description );
if ( veConfig.transclusionDialogNewSidebar && !knownAsMissing ) {
if ( !knownAsMissing ) {
var noticeWidget;
if ( this.template.getSpec().getDocumentedParameterOrder().length &&
@ -128,25 +116,6 @@ ve.ui.MWTemplatePage = function VeUiMWTemplatePage( template, name, config ) {
this.$element
.addClass( 've-ui-mwTemplatePage' )
.append( this.infoFieldset.$element );
if ( !config.isReadOnly ) {
if ( !veConfig.transclusionDialogNewSidebar ) {
// This button is only shown as a last resort when this …TemplatePage is neither followed by
// a …ParameterPage (i.e. the template doesn't have parameters) nor a
// …ParameterPlaceholderPage (i.e. the parameter search widget isn't shown). This state
// should be unreachable, but isn't. Hiding this is done via CSS.
var addButton = new OO.ui.ButtonWidget( {
framed: false,
icon: 'parameter',
label: ve.msg( 'visualeditor-dialog-transclusion-add-param' )
} )
.connect( this, { click: 'addPlaceholderParameter' } );
$( '<div>' )
.addClass( 've-ui-mwTemplatePage-more' )
.append( addButton.$element )
.appendTo( this.$element );
}
}
};
/* Inheritance */

View file

@ -119,14 +119,12 @@
}
.ve-ui-mwTransclusionDialog-collapsed .oo-ui-bookletLayout .oo-ui-fieldsetLayout > .oo-ui-iconElement-icon,
.ve-ui-mwTransclusionDialog-collapsed .oo-ui-bookletLayout .oo-ui-fieldsetLayout > .oo-ui-labelElement-label,
.ve-ui-mwTransclusionDialog-expanded .oo-ui-bookletLayout .ve-ui-mwTemplatePage-more {
.ve-ui-mwTransclusionDialog-collapsed .oo-ui-bookletLayout .oo-ui-fieldsetLayout > .oo-ui-labelElement-label {
display: none;
}
.ve-ui-mwTransclusionDialog.ve-ui-mwTemplateDialog-ready .oo-ui-bookletLayout .oo-ui-fieldsetLayout > .oo-ui-labelElement-label,
.ve-ui-mwTransclusionDialog.ve-ui-mwTemplateDialog-ready .oo-ui-bookletLayout .oo-ui-fieldsetLayout > .oo-ui-iconElement-icon,
.ve-ui-mwTransclusionDialog.ve-ui-mwTemplateDialog-ready .oo-ui-bookletLayout .ve-ui-mwTemplatePage-more,
.ve-ui-mwTransclusionDialog.ve-ui-mwTemplateDialog-ready .oo-ui-bookletLayout > .oo-ui-gridLayout > .oo-ui-panelLayout {
transition: all 250ms ease-in-out;
}

View file

@ -5,15 +5,6 @@
* @license The MIT License (MIT); see LICENSE.txt
*/
.ve-ui-mwTemplatePage-more {
display: none;
margin: 2.25em 0 0.5em 0;
}
.ve-ui-mwTemplatePage:last-child .ve-ui-mwTemplatePage-more {
display: block;
}
.ve-ui-mwTemplatePage-description {
color: #54595d;
overflow-wrap: break-word;