mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-28 00:00:49 +00:00
Display indicators for required parameters in template dialog
Update submodule for changes in OOUI (I1c047b55c7a0d5cf3e0aa0cc3f9a4da7d45c0304) Change-Id: I8f84a9ae277e5093356f591f7a56e8cebf4a1893
This commit is contained in:
parent
66d2d3da54
commit
c8f7845def
|
@ -669,6 +669,7 @@ $wgResourceModules += array(
|
|||
'visualeditor-dialog-transclusion-remove-content',
|
||||
'visualeditor-dialog-transclusion-remove-param',
|
||||
'visualeditor-dialog-transclusion-remove-template',
|
||||
'visualeditor-dialog-transclusion-required-parameter',
|
||||
'visualeditor-dialog-transclusion-title',
|
||||
'visualeditor-dialog-transclusion-wikitext-label',
|
||||
'visualeditor-dialogbutton-media-tooltip',
|
||||
|
|
|
@ -26,6 +26,17 @@ ve.dm.MWTemplateParameterModel = function VeDmMWTemplateParameterModel( template
|
|||
|
||||
/* Methods */
|
||||
|
||||
/**
|
||||
* Check if parameter is required.
|
||||
*
|
||||
* @method
|
||||
* @param {string} name Parameter name
|
||||
* @returns {boolean} Parameter is required
|
||||
*/
|
||||
ve.dm.MWTemplateParameterModel.prototype.isRequired = function () {
|
||||
return this.template.getSpec().isParameterRequired( this.name );
|
||||
};
|
||||
|
||||
/**
|
||||
* Get template parameter is part of.
|
||||
*
|
||||
|
|
|
@ -83,6 +83,7 @@
|
|||
"visualeditor-dialog-transclusion-remove-content": "Remove content",
|
||||
"visualeditor-dialog-transclusion-remove-param": "Remove parameter",
|
||||
"visualeditor-dialog-transclusion-remove-template": "Remove template",
|
||||
"visualeditor-dialog-transclusion-required-parameter": "Required parameter",
|
||||
"visualeditor-dialog-transclusion-title": "Transclusion",
|
||||
"visualeditor-dialogbutton-media-tooltip": "Media",
|
||||
"visualeditor-dialogbutton-meta-tooltip": "Page settings",
|
||||
|
|
|
@ -88,6 +88,7 @@
|
|||
"visualeditor-dialog-transclusion-remove-content": "Label for button that removes content between transclusion parts",
|
||||
"visualeditor-dialog-transclusion-remove-param": "Label for button that removes a parameter from a template",
|
||||
"visualeditor-dialog-transclusion-remove-template": "Label for button that removes a template from a transclusion.\n{{Identical|Remove template}}",
|
||||
"visualeditor-dialog-transclusion-required-parameter": "Tooltip for required parameter indicator",
|
||||
"visualeditor-dialog-transclusion-title": "{{Identical|Transclusion}}",
|
||||
"visualeditor-dialogbutton-media-tooltip": "{{Identical|Media}}",
|
||||
"visualeditor-dialogbutton-meta-tooltip": "{{Identical|Page settings}}",
|
||||
|
|
|
@ -18,7 +18,14 @@
|
|||
*/
|
||||
ve.ui.MWTemplateParameterPage = function VeUiMWTemplateParameter( parameter, name, config ) {
|
||||
// Configuration initialization
|
||||
config = ve.extendObject( { 'icon': 'parameter', 'movable': false, 'level': 1 }, config );
|
||||
config = ve.extendObject(
|
||||
parameter.isRequired() ? {
|
||||
'indicator': 'required',
|
||||
'indicatorLabel': ve.msg( 'visualeditor-dialog-transclusion-required-parameter' )
|
||||
} : {},
|
||||
{ 'icon': 'parameter', 'movable': false, 'level': 1 },
|
||||
config
|
||||
);
|
||||
|
||||
// Parent constructor
|
||||
OO.ui.PageLayout.call( this, name, config );
|
||||
|
|
Loading…
Reference in a new issue