Yaron Koren has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/311730

Change subject: New "tooltip" param for "display=table"
......................................................................

New "tooltip" param for "display=table"

Change-Id: Ieaf58994ef16707543710cd750bf28394b7023f9
---
M includes/SF_FormPrinter.php
1 file changed, 16 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SemanticForms 
refs/changes/30/311730/2

diff --git a/includes/SF_FormPrinter.php b/includes/SF_FormPrinter.php
index 303b23f..b367d99 100644
--- a/includes/SF_FormPrinter.php
+++ b/includes/SF_FormPrinter.php
@@ -410,6 +410,22 @@
                        $label = Html::element( 'label',
                                array( 'for' => "input_$sfgFieldNum" ),
                                $labelText );
+
+                       // If a 'tooltip' parameter was set, add a tooltip
+                       // right after the label.
+                       if ( $formField->hasFieldArg( 'tooltip' ) ) {
+                               global $wgOut, $wgScriptPath;
+
+                               $wgOut->addModules( 'ext.semanticforms.balloon' 
);
+                               $tooltipText = $formField->getFieldArg( 
'tooltip' );
+                               $label .= ' ' . Html::element( 'button', array(
+                                       'data-balloon-length' => 'medium',
+                                       'data-balloon' => $tooltipText,
+                                       'disabled' => true,
+                                       'style' => "height: 13px; width: 13px; 
background: url($wgScriptPath/resources/src/mediawiki/images/question.png); 
border: none;"
+                                       ), '' );
+                       }
+
                        $labelCell = Html::rawElement( 'th', null, $label );
                        $inputCell = Html::rawElement( 'td', null, 
$this->formFieldHTML( $formField, $curValue ) );
                        $html .= Html::rawElement( 'tr', null, $labelCell . 
$inputCell ) . "\n";

-- 
To view, visit https://gerrit.wikimedia.org/r/311730
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ieaf58994ef16707543710cd750bf28394b7023f9
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/SemanticForms
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren <yaro...@gmail.com>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to