jenkins-bot has submitted this change and it was merged. Change subject: More inline help for mixins ......................................................................
More inline help for mixins Also adds help message support for the top-level mixin label. Change-Id: I56fcb74f64ce9b181886391796105ecf2118c0f3 --- M CentralNotice.modules.php M CentralNotice.php M i18n/en.json M i18n/qqq.json M resources/infrastructure/campaignManager.js M special/SpecialCentralNotice.php 6 files changed, 31 insertions(+), 5 deletions(-) Approvals: Ejegg: Looks good to me, approved Siebrand: Looks good to me, but someone else must approve jenkins-bot: Verified diff --git a/CentralNotice.modules.php b/CentralNotice.modules.php index 1288f1b..4e37b1e 100644 --- a/CentralNotice.modules.php +++ b/CentralNotice.modules.php @@ -140,8 +140,11 @@ // Banner history logger 'centralnotice-banner-history-logger-rate', + 'centralnotice-banner-history-logger-rate-help', 'centralnotice-banner-history-logger-max-entry-age', + 'centralnotice-banner-history-logger-max-entry-age-help', 'centralnotice-banner-history-logger-max-entries', + 'centralnotice-banner-history-logger-max-entries-help', // Legacy campaigns 'centralnotice-set-record-impression-sample-rate', diff --git a/CentralNotice.php b/CentralNotice.php index f7abdea..ddc4371 100644 --- a/CentralNotice.php +++ b/CentralNotice.php @@ -252,24 +252,29 @@ 'bannerHistoryLogger' => array( 'module' => 'ext.centralNotice.bannerHistoryLogger', 'nameMsg' => 'centralnotice-banner-history-logger', + 'helpMsg' => 'centralnotice-banner-history-logger-help', 'parameters' => array( 'rate' => array( 'type' => 'float', 'labelMsg' => 'centralnotice-banner-history-logger-rate', + 'helpMsg' => 'centralnotice-banner-history-logger-rate-help', ), 'maxEntryAge' => array( 'type' => 'integer', - 'labelMsg' => 'centralnotice-banner-history-logger-max-entry-age' + 'labelMsg' => 'centralnotice-banner-history-logger-max-entry-age', + 'helpMsg' => 'centralnotice-banner-history-logger-max-entry-age-help' ), 'maxEntries' => array( 'type' => 'integer', - 'labelMsg' => 'centralnotice-banner-history-logger-max-entries' + 'labelMsg' => 'centralnotice-banner-history-logger-max-entries', + 'helpMsg' => 'centralnotice-banner-history-logger-max-entries-help' ) ) ), 'legacySupport' => array( 'module' => 'ext.centralNotice.legacySupport', 'nameMsg' => 'centralnotice-legacy-support', + 'helpMsg' => 'centralnotice-legacy-support-help', 'parameters' => array( 'setSRISampleRate' => array( 'type' => 'boolean', diff --git a/i18n/en.json b/i18n/en.json index 410d376..9441d1f 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -260,10 +260,15 @@ "apihelp-query+centralnoticelogs-param-end": "End time of range (optional).", "apihelp-query+centralnoticelogs-example-1": "Show logs", "centralnotice-banner-history-logger": "Banner history logger", - "centralnotice-banner-history-logger-rate": "Sample rate (should be between 0 and 1 inclusive)", + "centralnotice-banner-history-logger-help": "Track the sequence of banners seen by readers, and occasionally send it back to the server.", + "centralnotice-banner-history-logger-rate": "Sample rate", + "centralnotice-banner-history-logger-rate-help": "Probability that data will be sampled and sent back to the server. Decimal between 0 (never) and 1 (always).", "centralnotice-banner-history-logger-max-entry-age": "Maximum age of log entries (in days)", + "centralnotice-banner-history-logger-max-entry-age-help": "Log entries older than this will be expired and will not be sent back to the server.", "centralnotice-banner-history-logger-max-entries": "Maximum number of entries to keep in log", + "centralnotice-banner-history-logger-max-entries-help": "If more history is recorded before the log is sent to the server, the oldest items will disappear.", "centralnotice-legacy-support": "Legacy support", + "centralnotice-legacy-support-help": "Settings for compatibility with older banners that rely on Special:RecordImpression or include JavaScript that hides the banner.", "centralnotice-set-record-impression-sample-rate": "Set sample rate for Special:RecordImpression", "centralnotice-custom-record-impression-sample-rate": "Special:RecordImpression sample rate (should be between 0 and 1 inclusive)", "centralnotice-banners-not-guaranteed-to-display": "Banners might not display, as determined by in-banner JavaScript" diff --git a/i18n/qqq.json b/i18n/qqq.json index 4bf8458..0ffbc04 100644 --- a/i18n/qqq.json +++ b/i18n/qqq.json @@ -283,10 +283,15 @@ "apihelp-query+centralnoticelogs-param-end": "{{doc-apihelp-param|query+centralnoticelogs|end}}", "apihelp-query+centralnoticelogs-example-1": "{{doc-apihelp-example|query+centralnoticelogs}}", "centralnotice-banner-history-logger": "Name of the banner history logger campaign mixin, for adminsitration UI control", + "centralnotice-banner-history-logger-help": "Description of the banner history feature", "centralnotice-banner-history-logger-rate": "Label for the banner history logger campaign mixin sample rate control in the administration UI", + "centralnotice-banner-history-logger-rate-help": "Help text for the sample rate field", "centralnotice-banner-history-logger-max-entry-age": "Label for the banner history logger campaign mixin maximum entry age control in the administration UI", + "centralnotice-banner-history-logger-max-entry-age-help": "Help text for the log expiration age field", "centralnotice-banner-history-logger-max-entries": "Label for the banner history logger campaign mixin maximum number of log entries control in the administration UI", + "centralnotice-banner-history-logger-max-entries-help": "Help text for the maximum log size field", "centralnotice-legacy-support": "Name of the legacy support campaign mixin, for administration UI control", + "centralnotice-legacy-support-help": "Description of the legacy support feature", "centralnotice-set-record-impression-sample-rate": "Label for the control to activate setting the sample rate for Special:RecordImpression, for the legacy support campaign mixin", "centralnotice-custom-record-impression-sample-rate": "Label for the control to determine the sample rate for Special:RecordImpression, for the legacy support campaign mixin", "centralnotice-banners-not-guaranteed-to-display": "Label for the control to indicate that banners might not display, for the legacy support campaign mixin" diff --git a/resources/infrastructure/campaignManager.js b/resources/infrastructure/campaignManager.js index 58c99d2..2d7ad7a 100644 --- a/resources/infrastructure/campaignManager.js +++ b/resources/infrastructure/campaignManager.js @@ -102,7 +102,7 @@ paramValues ); - $checkBox.next( 'label' ).after( $paramControlSet ); + $checkBox.parent( 'div' ).append( $paramControlSet ); // Hook up handler for verification $paramControls = $paramControlSet.find( 'input' ); diff --git a/special/SpecialCentralNotice.php b/special/SpecialCentralNotice.php index f6a7573..e8aae80 100644 --- a/special/SpecialCentralNotice.php +++ b/special/SpecialCentralNotice.php @@ -746,7 +746,8 @@ // Handle campaign-associated mixins foreach ( $wgCentralNoticeCampaignMixins - as $mixinName => $mixinDef ) { + as $mixinName => $mixinDef + ) { $mixinControlName = self::makeNoticeMixinControlName( $mixinName ); @@ -1046,6 +1047,13 @@ array( 'for' => $mixinControlName ) ); + if ( !empty( $mixinDef['helpMsg'] ) ) { + $htmlOut .= Html::element( 'div', + array( 'class' => 'htmlform-help' ), + $this->msg( $mixinDef['helpMsg'] )->text() + ); + } + $htmlOut .= Xml::closeElement( 'div' ); } -- To view, visit https://gerrit.wikimedia.org/r/239302 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I56fcb74f64ce9b181886391796105ecf2118c0f3 Gerrit-PatchSet: 7 Gerrit-Project: mediawiki/extensions/CentralNotice Gerrit-Branch: master Gerrit-Owner: Awight <awi...@wikimedia.org> Gerrit-Reviewer: AndyRussG <andrew.green...@gmail.com> Gerrit-Reviewer: Awight <awi...@wikimedia.org> Gerrit-Reviewer: Cdentinger <cdentin...@wikimedia.org> Gerrit-Reviewer: Ejegg <eeggles...@wikimedia.org> Gerrit-Reviewer: Katie Horn <kh...@wikimedia.org> Gerrit-Reviewer: Siebrand <siebr...@kitano.nl> Gerrit-Reviewer: Ssmith <ssm...@wikimedia.org> Gerrit-Reviewer: XenoRyet <dkozlow...@wikimedia.org> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits