2021-07-09 15:04:14 +00:00
|
|
|
/**
|
|
|
|
* @class
|
|
|
|
* @extends ve.ui.MWTransclusionOutlinePartWidget
|
|
|
|
*
|
|
|
|
* @constructor
|
2021-07-09 15:33:16 +00:00
|
|
|
* @param {ve.dm.MWTemplatePlaceholderModel} placeholder
|
2021-07-09 15:04:14 +00:00
|
|
|
* @param {Object} [config]
|
|
|
|
*/
|
2021-07-09 15:33:16 +00:00
|
|
|
ve.ui.MWTransclusionOutlinePlaceholderWidget = function VeUiMWTransclusionOutlinePlaceholderWidget( placeholder, config ) {
|
|
|
|
var label = placeholder.getTransclusion().getParts().length === 1 ?
|
|
|
|
'visualeditor-dialog-transclusion-template-search' :
|
|
|
|
'visualeditor-dialog-transclusion-add-template';
|
|
|
|
|
2021-07-09 15:04:14 +00:00
|
|
|
// Initialize config
|
|
|
|
config = $.extend( {
|
|
|
|
icon: 'puzzle',
|
2021-07-09 15:33:16 +00:00
|
|
|
// The following messages are used here:
|
|
|
|
// * visualeditor-dialog-transclusion-template-search
|
|
|
|
// * visualeditor-dialog-transclusion-add-template
|
|
|
|
label: ve.msg( label )
|
2021-07-09 15:04:14 +00:00
|
|
|
}, config );
|
|
|
|
|
|
|
|
// Parent constructor
|
2021-07-13 07:27:22 +00:00
|
|
|
ve.ui.MWTransclusionOutlinePlaceholderWidget.super.call( this, placeholder, config );
|
2021-07-09 15:33:16 +00:00
|
|
|
|
|
|
|
this.placeholder = placeholder;
|
2021-07-09 15:04:14 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/* Inheritance */
|
|
|
|
|
|
|
|
OO.inheritClass( ve.ui.MWTransclusionOutlinePlaceholderWidget, ve.ui.MWTransclusionOutlinePartWidget );
|