Mollywhite has uploaded a new change for review.

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


Change subject: Bug 53290: Add descriptive titles for edit/rename buttons in 
editor.
......................................................................

Bug 53290: Add descriptive titles for edit/rename buttons in editor.

The edit/create/rename buttons in the JSON editor did not have
title attributes, so there was no description of the action they
were performing. This patch adds these.

Bug: 53290
Change-Id: I65e0e0dff4ff6a2c95e493cd68547be2b485e4fb
---
M BookManagerv2.i18n.php
M JsonEditor.php
2 files changed, 22 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BookManagerv2 
refs/changes/93/80693/1

diff --git a/BookManagerv2.i18n.php b/BookManagerv2.i18n.php
index 4d5d20d..e64a10a 100644
--- a/BookManagerv2.i18n.php
+++ b/BookManagerv2.i18n.php
@@ -78,6 +78,10 @@
        'bookmanagerv2-lccn-field' => 'LCCN',
        'bookmanagerv2-oclc-field' => 'OCLC',
        'bookmanagerv2-sections-field' => 'Sections',
+       'bookmanagerv2-add-section-title' => 'Add a new section to this work',
+       'bookmanagerv2-edit-title' => 'Edit this section',
+       'bookmanagerv2-create-title' => 'Create this section',
+       'bookmanagerv2-rename-title' => 'Rename this section',
 );
 
 /** Message documentation (Message documentation)
@@ -247,6 +251,10 @@
        'bookmanagerv2-oclc-field' => 'JSON editor input field label. OCLC is 
the Online Computer Library Center ([http://en.wikipedia.org/wiki/OCLC OCLC])',
        'bookmanagerv2-sections-field' => 'JSON editor input field label.
 {{Identical|Section}}',
+       'bookmanagerv2-add-section-title' => 'Title for the "add" link that 
allows a user to add a new section to the current work',
+       'bookmanagerv2-edit-title' => 'Title for the "edit" link that appears 
on each section in the JSON editor that already has a page on the wiki. This 
explains that clicking "edit" will take them to the edit page for that 
section.',
+       'bookmanagerv2-create-title' => 'Title for the "create" link that 
appears on sections in the JSON editor that don\'t already have pages. It 
explains that clicking "create" will take them to create that section.',
+       'bookmanagerv2-rename-title' => 'Title for the "rename" link that 
appears on each section in the JSON editor. This explains that clicking 
"rename" will allow them to rename the section.',
 );
 
 /** Akan (Akan)
diff --git a/JsonEditor.php b/JsonEditor.php
index 70ab037..61a50d4 100644
--- a/JsonEditor.php
+++ b/JsonEditor.php
@@ -85,6 +85,8 @@
                . Html::element( 'a', array(
                        'href' => '#',
                        'class' => 'mw-bookmanagerv2-add',
+                       'title' => wfMessage(
+                               'bookmanagerv2-add-section-title' )->escaped(),
                        'id' => $id,
                        'tabindex' => $tabindex
                ), wfMessage( 'bookmanagerv2-add' )->text() )
@@ -217,8 +219,12 @@
                                $sectionTitle = Title::newFromText( 
$section->link );
                                if ( $sectionTitle->exists() ) {
                                        $sectionLinkName = wfMessage( 
'editlink' )->text();
+                                       $sectionLinkTitle = wfMessage(
+                                               'bookmanagerv2-edit-title' 
)->escaped();
                                } else {
                                        $sectionLinkName = wfMessage( 
'bookmanagerv2-create' )->text();
+                                       $sectionLinkTitle = wfMessage(
+                                               'bookmanagerv2-create-title' 
)->escaped();
                                }
                                $html .= Html::openElement( 'li', array(
                                        'class' => 'mw-bookmanagerv2-section',
@@ -230,7 +236,7 @@
                                        $section->name,
                                        array(
                                                'class' => 
'mw-bookmanagerv2-section-link',
-                                               'tabindex' => $tabindex++
+                                               'tabindex' => $tabindex++,
                                        ),
                                        array(),
                                        array()
@@ -244,7 +250,10 @@
                                . Linker::link(
                                        $sectionTitle,
                                        $sectionLinkName,
-                                       array( 'tabindex' => $tabindex++ ),
+                                       array(
+                                               'tabindex' => $tabindex++,
+                                               'title' => $sectionLinkTitle
+                                       ),
                                        array( 'action' => 'edit' ),
                                        array( 'noclasses' )
                                )
@@ -254,7 +263,9 @@
                                . Html::element( 'a', array(
                                        'class' => 'mw-bookmanagerv2-rename',
                                        'href' => '#',
-                                       'tabindex' => $tabindex++
+                                       'tabindex' => $tabindex++,
+                                       'title' => wfMessage(
+                                               'bookmanagerv2-rename-title' 
)->escaped()
                                ), wfMessage( 'bookmanagerv2-rename' ) )
                                . Html::element( 'span', array(
                                        'class' => 
'mw-bookmanagerv2-link-bracket'

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I65e0e0dff4ff6a2c95e493cd68547be2b485e4fb
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BookManagerv2
Gerrit-Branch: master
Gerrit-Owner: Mollywhite <[email protected]>
Gerrit-Reviewer: jenkins-bot

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

Reply via email to