Awight has uploaded a new change for review.
https://gerrit.wikimedia.org/r/236422
Change subject: Support help text for mixin parameters
......................................................................
Support help text for mixin parameters
Change-Id: I9fb9ec1583a16da2ac469bf5ea4e7c4c26a6970b
---
M CentralNotice.modules.php
M resources/infrastructure/campaignManager.css
M resources/infrastructure/campaignManager.js
M templates/campaignMixinParamControls.mustache
4 files changed, 17 insertions(+), 1 deletion(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CentralNotice
refs/changes/22/236422/1
diff --git a/CentralNotice.modules.php b/CentralNotice.modules.php
index 4fc5c47..77b3740 100644
--- a/CentralNotice.modules.php
+++ b/CentralNotice.modules.php
@@ -130,6 +130,7 @@
'templates' => array(
'campaignMixinParamControls.mustache' =>
'templates/campaignMixinParamControls.mustache'
),
+ // FIXME: Registering mixin messages in this central place is not
modular.
'messages' => array(
'centralnotice-notice-mixins-int-required',
'centralnotice-notice-mixins-float-required',
diff --git a/resources/infrastructure/campaignManager.css
b/resources/infrastructure/campaignManager.css
index 5b90ce1..40dfc38 100644
--- a/resources/infrastructure/campaignManager.css
+++ b/resources/infrastructure/campaignManager.css
@@ -34,3 +34,10 @@
font-weight: bold;
line-height: 200%;
}
+
+/** TODO: reuse mw-core input description style */
+.htmlform-tip {
+ font-size: x-small;
+ color: #666;
+ margin-bottom: 1.5em;
+}
diff --git a/resources/infrastructure/campaignManager.js
b/resources/infrastructure/campaignManager.js
index cba439f..58c99d2 100644
--- a/resources/infrastructure/campaignManager.js
+++ b/resources/infrastructure/campaignManager.js
@@ -209,6 +209,10 @@
}
}
+ if ( paramDef.helpMsg ) {
+ paramTemplateVars.help = mw.message(
paramDef.helpMsg ).text();
+ }
+
templateVars.params.push( paramTemplateVars );
} );
diff --git a/templates/campaignMixinParamControls.mustache
b/templates/campaignMixinParamControls.mustache
index 2fe3a75..8bdeb32 100644
--- a/templates/campaignMixinParamControls.mustache
+++ b/templates/campaignMixinParamControls.mustache
@@ -10,7 +10,11 @@
name="{{inputName}}"
{{#checkedFlagAndVar}}checked="{{checked}}"{{/checkedFlagAndVar}}
data-data-type="{{dataType}}" />
+
+ {{#help}}
+ <div class="htmlform-tip">{{help}}</div>
+ {{/help}}
</label>
</p>
{{/params}}
-</div>
\ No newline at end of file
+</div>
--
To view, visit https://gerrit.wikimedia.org/r/236422
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I9fb9ec1583a16da2ac469bf5ea4e7c4c26a6970b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CentralNotice
Gerrit-Branch: master
Gerrit-Owner: Awight <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits