From ae3099d674dccf253257201a9850960f519ff059 Mon Sep 17 00:00:00 2001 From: CosmicAlpha Date: Mon, 25 Nov 2024 14:31:49 -0700 Subject: [PATCH] PortableInfoboxBuilder: add support for format (#125) --- extension.json | 1 + i18n/en.json | 1 + resources/PortableInfoboxBuilder.js | 11 +++++++++++ 3 files changed, 13 insertions(+) diff --git a/extension.json b/extension.json index d122297..4cbaff4 100644 --- a/extension.json +++ b/extension.json @@ -96,6 +96,7 @@ "infoboxbuilder-nodeerror-invalidsource", "infoboxbuilder-nodeerror-nosourceordefault", "infoboxbuilder-nodeparam-default", + "infoboxbuilder-nodeparam-format", "infoboxbuilder-nodeparam-label", "infoboxbuilder-nodeparam-source", "infoboxbuilder-nodeparam-value", diff --git a/i18n/en.json b/i18n/en.json index 30b138b..6da4032 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -46,6 +46,7 @@ "infoboxbuilder-nodeerror-invalidsource": "Source parameter is invalid.", "infoboxbuilder-nodeerror-nosourceordefault": "Element without source parameter or default value won't be displayed.", "infoboxbuilder-nodeparam-default": "Default value", + "infoboxbuilder-nodeparam-format": "Format", "infoboxbuilder-nodeparam-label": "Label", "infoboxbuilder-nodeparam-source": "Source parameter", "infoboxbuilder-nodeparam-value": "Value", diff --git a/resources/PortableInfoboxBuilder.js b/resources/PortableInfoboxBuilder.js index e3e916a..a282103 100644 --- a/resources/PortableInfoboxBuilder.js +++ b/resources/PortableInfoboxBuilder.js @@ -127,6 +127,10 @@ placeholder: this.msg( 'nodeparam-label' ), disabled: true } ); + this.nodeInputFormat = new OO.ui.TextInputWidget( { + placeholder: this.msg( 'nodeparam-format' ), + disabled: true + } ); this.nodeInputDefault = new OO.ui.TextInputWidget( { placeholder: this.msg( 'nodeparam-default' ), disabled: true @@ -154,6 +158,12 @@ help: this.msg( 'nodeparamhelp-label', [], true ), disabled: true } ).$element, + new OO.ui.FieldLayout( this.nodeInputFormat, { + label: this.msg( 'nodeparam-format' ), + align: 'top', + help: this.msg( 'nodeparamhelp-format', [], true ), + disabled: true + } ).$element, new OO.ui.FieldLayout( this.nodeInputDefault, { label: this.msg( 'nodeparam-default' ), align: 'top', @@ -180,6 +190,7 @@ this.toggleNodeMenuWidget( this.nodeInputSource, supports.source, 'source' ); this.toggleNodeMenuWidget( this.nodeInputLabel, supports.label, 'label' ); + this.toggleNodeMenuWidget( this.nodeInputFormat, supports.format, 'format' ); this.toggleNodeMenuWidget( this.nodeInputDefault, supports.default, 'default' ); this.toggleNodeMenuWidget( this.nodeInputValue, supports.value, 'value' ); }