Amire80 has uploaded a new change for review.

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


Change subject: (bug 45540) Add tooltips to the proofread and edit buttons
......................................................................

(bug 45540) Add tooltips to the proofread and edit buttons

This adds on-hover tooltips to the proofread and edit buttons
in proofread mode.

This doesn't yet handle the "first proofreading" scenario.

Change-Id: I5c962cb983f5ffe3625748bd985850f29579c946
---
M Translate.i18n.php
M Translate.php
M resources/js/ext.translate.proofread.js
3 files changed, 29 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Translate 
refs/changes/39/53039/1

diff --git a/Translate.i18n.php b/Translate.i18n.php
index c93898e..1a6a7a6 100644
--- a/Translate.i18n.php
+++ b/Translate.i18n.php
@@ -468,6 +468,8 @@
        'tux-editor-translate-mode' => 'List',
        'tux-editor-proofreading-hide-own-translations' => 'Hide your 
translations',
        'tux-editor-proofreading-show-own-translations' => 'Show your 
translations',
+       'tux-proofread-action-tooltip' => 'Mark the translation as verified',
+       'tux-proofread-edit-tooltip' => 'Translate',
        'tux-editor-page-mode' => 'Page',
        'tux-editor-outdated-warning' => 'This translation may need to be 
updated.',
        'tux-editor-outdated-warning-diff-link' => 'Show differences',
@@ -495,7 +497,6 @@
        'tux-editor-close-tooltip' => 'Close',
        'tux-editor-expand-tooltip' => 'Expand',
        'tux-editor-collapse-tooltip' => 'Collapse',
-
 );
 
 /** Message documentation (Message documentation)
@@ -989,6 +990,8 @@
 
 See also:
 * {{msg-mw|Tux-editor-proofreading-hide-own-translations}}",
+       'tux-proofread-action-tooltip' => 'A tooltip shown to new users next to 
the button that performs the proofreading.',
+       'tux-proofread-edit-tooltip' => 'A tooltop shown to new users next to 
the translation button in proofreading mode.',
        'tux-editor-page-mode' => 'Label for the button that appears at the 
footer of the translation editor.
 Pressing the button goes to the page mode.
 {{Identical|Page}}',
diff --git a/Translate.php b/Translate.php
index ebc809a..767d014 100644
--- a/Translate.php
+++ b/Translate.php
@@ -257,6 +257,7 @@
                'mediawiki.user',
                'mediawiki.jqueryMsg',
                'jquery.makeCollapsible',
+               'jquery.tipsy',
        ),
        'messages' => array(
                'tux-status-translated',
@@ -289,6 +290,8 @@
                'translate-edit-askpermission',
                'tux-editor-outdated-warning',
                'tux-editor-outdated-warning-diff-link',
+               'tux-proofread-action-tooltip',
+               'tux-proofread-edit-tooltip',
                'tux-editor-close-tooltip',
                'tux-editor-expand-tooltip',
                'tux-editor-collapse-tooltip',
diff --git a/resources/js/ext.translate.proofread.js 
b/resources/js/ext.translate.proofread.js
index cbe99be..1dfb4de 100644
--- a/resources/js/ext.translate.proofread.js
+++ b/resources/js/ext.translate.proofread.js
@@ -138,12 +138,22 @@
                },
 
                render: function () {
-                       var targetLanguage, targetLanguageDir, sourceLanguage, 
sourceLanguageDir;
+                       var targetLanguage, targetLanguageDir, sourceLanguage, 
sourceLanguageDir,
+                               $proofreadAction, $proofreadEdit;
 
                        sourceLanguage = this.$container.data( 'sourcelangcode' 
);
                        sourceLanguageDir = $.uls.data.getDir( sourceLanguage );
                        targetLanguage = this.$container.data( 'targetlangcode' 
);
                        targetLanguageDir = $.uls.data.getDir( targetLanguage );
+
+                       $proofreadAction = $( '<div>' )
+                               .attr( 'title', mw.msg( 
'tux-proofread-action-tooltip' ) )
+                               .addClass(
+                                       'tux-proofread-action ' + 
this.message.properties.status
+                               );
+                       $proofreadEdit = $( '<div>' )
+                               .attr( 'title', mw.msg( 
'tux-proofread-edit-tooltip' ) )
+                               .addClass( 'tux-proofread-edit' );
 
                        this.$message.append(
                                $( '<div>' )
@@ -164,13 +174,20 @@
                                        .text( this.message.translation || '' ),
                                $( '<div>' )
                                        .addClass( 'tux-proofread-action-block 
one column' )
-                                       .append( $( '<div>' )
-                                               .addClass( 
'tux-proofread-action ' + this.message.properties.status),
-                                               $( '<div>' )
-                                                       .addClass( 
'tux-proofread-edit' )
+                                       .append(
+                                               $proofreadAction,
+                                               $proofreadEdit
                                        )
                        )
                        .addClass( this.message.properties.status );
+
+                       $proofreadAction.tipsy( {
+                               gravity: 's'
+                       } );
+
+                       $proofreadEdit.tipsy( {
+                               gravity: 'n'
+                       } );
                },
 
                hide: function () {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5c962cb983f5ffe3625748bd985850f29579c946
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Translate
Gerrit-Branch: master
Gerrit-Owner: Amire80 <[email protected]>

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

Reply via email to