Merge "Minor fixes to template dialog related code documentation"

This commit is contained in:
jenkins-bot 2022-07-14 07:01:11 +00:00 committed by Gerrit Code Review
commit b4b6940c64
6 changed files with 15 additions and 26 deletions

View file

@ -74,7 +74,7 @@ OO.inheritClass( ve.ui.MWTwoPaneTransclusionDialogLayout, OO.ui.MenuLayout );
/**
* @private
* @param {Object} visibility
* @param {Object.<string,boolean>} visibility
*/
ve.ui.MWTwoPaneTransclusionDialogLayout.prototype.onFilterPagesByName = function ( visibility ) {
for ( var pageName in visibility ) {
@ -150,7 +150,7 @@ ve.ui.MWTwoPaneTransclusionDialogLayout.prototype.focusPart = function ( pageNam
* Parts and parameters can be soft-selected, or selected and focused.
*
* @param {string|null} pageName Full, unique name of part or parameter, or null to deselect
* @param {string} [soft] If true, suppress content pane focus.
* @param {boolean} [soft] If true, suppress content pane focus.
*/
ve.ui.MWTwoPaneTransclusionDialogLayout.prototype.onSidebarItemSelected = function ( pageName, soft ) {
this.setPage( pageName );

View file

@ -12,6 +12,7 @@
* @constructor
* @param {Object} config
* @cfg {ve.ui.MWTransclusionOutlineParameterWidget[]} items
* @property {string|null} itemSet Name of the currently selected parameter
*/
ve.ui.MWTransclusionOutlineParameterSelectWidget = function VeUiMWTransclusionOutlineParameterSelectWidget( config ) {
// Parent constructor

View file

@ -1,9 +1,3 @@
/*!
* VisualEditor user interface MWTransclusionOutlineParameterWidget class.
*
* @license The MIT License (MIT); see LICENSE.txt
*/
/**
* A widget that represents a template parameter, with a checkbox to add/remove the parameter.
* Modelled after {@see OO.ui.OutlineOptionWidget}. Also see {@see OO.ui.CheckboxMultioptionWidget}
@ -79,6 +73,9 @@ ve.ui.MWTransclusionOutlineParameterWidget.prototype.setSelected = function ( st
return this;
};
/**
* @param {boolean} state
*/
ve.ui.MWTransclusionOutlineParameterWidget.prototype.setParameter = function ( state ) {
this.$element.toggleClass( 've-ui-mwTransclusionOutlineParameterWidget-isSet', state );
};

View file

@ -1,7 +1,3 @@
/*!
* @license The MIT License (MIT); see LICENSE.txt
*/
/**
* Container for a template as rendered in the template dialog sidebar.
* Contains search and visibility inputs, and a list of parameters when available.
@ -450,7 +446,7 @@ ve.ui.MWTransclusionOutlineTemplateWidget.prototype.filterParameters = function
/**
* @private
* @param {boolean} visibility
* @param {boolean} fromClick
* @param {boolean} [fromClick]
*/
ve.ui.MWTransclusionOutlineTemplateWidget.prototype.onToggleUnusedFields = function ( visibility, fromClick ) {
if ( visibility ) {

View file

@ -33,6 +33,8 @@ OO.inheritClass( ve.ui.MWTransclusionOutlineToggleUnusedWidget, OO.ui.ButtonWidg
/**
* @event toggleUnusedFields
* @param {boolean} visibility If unused fields should be shown or not.
* @param {boolean} [fromClick]
* Emitted when the visibility for unused fields should be (re)applied.
*/

View file

@ -1,9 +1,3 @@
/*!
* VisualEditor user interface MWTransclusionOutlineWidget class.
*
* @license The MIT License (MIT); see LICENSE.txt
*/
/**
* Container for the entire transclusion dialog sidebar, may contain a single or
* multiple templates or raw wikitext snippets.
@ -43,7 +37,7 @@ OO.inheritClass( ve.ui.MWTransclusionOutlineWidget, OO.ui.Widget );
* @event sidebarPartSelected
* @param {string} pageName Unique id of the {@see OO.ui.BookletLayout} page, e.g. something like
* "part_1" or "part_1/param1".
* @param {string} [soft] If true, don't focus the content pane. Defaults to false.
* @param {boolean} [soft] If true, don't focus the content pane. Defaults to false.
*/
/* Methods */
@ -65,7 +59,7 @@ ve.ui.MWTransclusionOutlineWidget.prototype.onReplacePart = function ( removed,
/**
* Handle spacebar in a part header
*
* @param {*} pageName
* @param {string} pageName
* @fires sidebarPartSelected
*/
ve.ui.MWTransclusionOutlineWidget.prototype.onTransclusionPartSoftSelected = function ( pageName ) {
@ -100,7 +94,6 @@ ve.ui.MWTransclusionOutlineWidget.prototype.addPartWidget = function ( part, new
if ( part instanceof ve.dm.MWTemplateModel ) {
widget = new ve.ui.MWTransclusionOutlineTemplateWidget( part, removed instanceof ve.dm.MWTemplatePlaceholderModel );
// This forwards events from the nested ve.ui.MWTransclusionOutlineTemplateWidget upwards.
// The array syntax is a way to call `this.emit( 'filterParameters' )`.
widget.connect( this, {
// We can forward these events as is. The parameter's unique ids are reused as page
// names in {@see ve.ui.MWTemplateDialog.onAddParameter}.
@ -204,10 +197,10 @@ ve.ui.MWTransclusionOutlineWidget.prototype.clear = function () {
/**
* @private
*
* @param {Object} parameter
* @param {Object.<string,boolean>} visibility
* @fires filterPagesByName
*/
ve.ui.MWTransclusionOutlineWidget.prototype.onFilterParametersByName = function ( parameter ) {
this.emit( 'filterPagesByName', parameter );
ve.ui.MWTransclusionOutlineWidget.prototype.onFilterParametersByName = function ( visibility ) {
this.emit( 'filterPagesByName', visibility );
this.setSelectionByPageName();
};