From 91d24bf2ec5671f8464bd6ef2e9739d4b1b53e78 Mon Sep 17 00:00:00 2001 From: Thiemo Kreuz Date: Thu, 23 Sep 2021 16:38:33 +0200 Subject: [PATCH] Document the 3 ways the template dialog can be opened Change-Id: I9729eb238f4a4f0712a561b77e3d97f4e9063938 --- modules/ve-mw/ui/dialogs/ve.ui.MWTemplateDialog.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/modules/ve-mw/ui/dialogs/ve.ui.MWTemplateDialog.js b/modules/ve-mw/ui/dialogs/ve.ui.MWTemplateDialog.js index 89e62452f6..e84a822cd3 100644 --- a/modules/ve-mw/ui/dialogs/ve.ui.MWTemplateDialog.js +++ b/modules/ve-mw/ui/dialogs/ve.ui.MWTemplateDialog.js @@ -511,7 +511,9 @@ ve.ui.MWTemplateDialog.prototype.getSetupProcess = function ( data ) { // Initialization if ( !this.selectedNode ) { if ( data.template ) { - // New specified template + // The template name is from MediaWiki:Visualeditor-cite-tool-definition.json, + // passed via a ve.ui.Command, which triggers a ve.ui.MWCitationAction, which + // executes ve.ui.WindowAction.open(), which opens this dialog. var template = ve.dm.MWTemplateModel.newFromName( this.transclusionModel, data.template ); @@ -519,13 +521,13 @@ ve.ui.MWTemplateDialog.prototype.getSetupProcess = function ( data ) { this.initializeNewTemplateParameters.bind( this ) ); } else { - // New template placeholder + // Open the dialog to add a new template, always starting with a placeholder promise = this.transclusionModel.addPart( new ve.dm.MWTemplatePlaceholderModel( this.transclusionModel ) ); } } else { - // Load existing template + // Open the dialog to edit an existing template // TODO tracking will only be implemented temporarily to answer questions on // template usage for the Technical Wishes topic area see T258917