Yaron Koren has uploaded a new change for review.

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

Change subject: Added support for "tooltip" for autoedit/formlink/formredlink 
buttons
......................................................................

Added support for "tooltip" for autoedit/formlink/formredlink buttons

Change-Id: I47fd82c526aa9031e99cdb8bd776f1e56b1a965a
---
M includes/SF_ParserFunctions.php
1 file changed, 6 insertions(+), 2 deletions(-)


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

diff --git a/includes/SF_ParserFunctions.php b/includes/SF_ParserFunctions.php
index 3e2711d..bc28172 100644
--- a/includes/SF_ParserFunctions.php
+++ b/includes/SF_ParserFunctions.php
@@ -564,7 +564,11 @@
                if ( $linkType == 'button' ) {
                        // Html::rawElement() before MW 1.21 or so drops the 
type attribute
                        // do not use Html::rawElement() for buttons!
-                       $linkElement = '<button ' . Html::expandAttributes( 
array( 'type' => 'submit', 'class' => $classString ) ) . '>' . $linkString . 
'</button>';
+                       $attrs = array( 'type' => 'submit', 'class' => 
$classString );
+                       if ( $inTooltip != null ) {
+                               $attrs['title'] = $inTooltip;
+                       }
+                       $linkElement = '<button ' . Html::expandAttributes( 
$attrs ) . '>' . $linkString . '</button>';
                } elseif ( $linkType == 'link' ) {
                        $attrs = array( 'class' => $classString, 'href' => "#" 
);
                        if ( $inTooltip != null ) {
@@ -739,7 +743,7 @@
 
                                // Html::rawElement() before MW 1.21 or so 
drops the type attribute
                                // do not use Html::rawElement() for buttons!
-                               '<button ' . Html::expandAttributes( array( 
'type' => 'submit', 'value' => $inLinkStr ) ) . '>' . $inLinkStr . '</button>' .
+                               '<button ' . Html::expandAttributes( array( 
'type' => 'submit', 'value' => $inLinkStr, 'title' => $inTooltip ) ) . '>' . 
$inLinkStr . '</button>' .
                                $hidden_inputs
                        );
                } else {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I47fd82c526aa9031e99cdb8bd776f1e56b1a965a
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/SemanticForms
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to