mediawiki-extensions-Visual.../modules/ve-mw/ui/widgets/ve.ui.MWTransclusionOutlinePlaceholderWidget.js
Ed Sanders dbc696124f ESLint: Enforce no-var and autofix
Temporarily disable prefer-const as this requires
manual fixing.

Change-Id: I477b69a57e8d33535c6fc71dba196a8605780725
2024-05-21 17:40:52 +01:00

28 lines
888 B
JavaScript

/**
* Sidebar item for a template which has yet to be added, its name is not yet
* given.
*
* @class
* @extends ve.ui.MWTransclusionOutlinePartWidget
*
* @constructor
* @param {ve.dm.MWTemplatePlaceholderModel} placeholder
*/
ve.ui.MWTransclusionOutlinePlaceholderWidget = function VeUiMWTransclusionOutlinePlaceholderWidget( placeholder ) {
const label = placeholder.getTransclusion().isSingleTemplate() ?
ve.msg( 'visualeditor-dialog-transclusion-template-search' ) :
ve.msg( 'visualeditor-dialog-transclusion-add-template' );
// Parent constructor
ve.ui.MWTransclusionOutlinePlaceholderWidget.super.call( this, placeholder, {
icon: 'puzzle',
label: label
} );
this.$element.addClass( 've-ui-mwTransclusionOutlinePlaceholderWidget' );
};
/* Inheritance */
OO.inheritClass( ve.ui.MWTransclusionOutlinePlaceholderWidget, ve.ui.MWTransclusionOutlinePartWidget );