Mollywhite has uploaded a new change for review.

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


Change subject: Bug 51258: Add title and alt attributes for icons.
......................................................................

Bug 51258: Add title and alt attributes for icons.

Add descriptions of the metadata and table of contents icons
for accessibility and image fallback.

Bug: 51258
Change-Id: I3e819b345be02d90610f7c92a65a47317f0f41b4
---
M BookManagerv2.hooks.php
M BookManagerv2.i18n.php
M modules/ext.BookManagerv2.css
3 files changed, 22 insertions(+), 18 deletions(-)


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

diff --git a/BookManagerv2.hooks.php b/BookManagerv2.hooks.php
index e424a3a..b50b46b 100644
--- a/BookManagerv2.hooks.php
+++ b/BookManagerv2.hooks.php
@@ -52,7 +52,9 @@
                        );
                $html[] = Html::element( 'img', array(
                                'class' => 'mw-bookmanagerv2-nav-data',
-                               'src' => $imagePath . 
'Info_sign_font_awesome.png'
+                               'src' => $imagePath . 
'Info_sign_font_awesome.png',
+                               'alt' => wfMessage( 'bookmanagerv2-metadata' 
)->text(),
+                               'title' => wfMessage( 'bookmanagerv2-metadata' 
)->text()
                        ), '' );
                $html[] = Html::closeElement( 'a' );
                $html[] = Html::openElement( 'a', array(
@@ -63,14 +65,18 @@
                        );
                $html[] = Html::element( 'img', array(
                                'class' => 'mw-bookmanagerv2-nav-toc',
-                               'src' => $imagePath . 'Ul_font_awesome.png'
+                               'src' => $imagePath . 'Ul_font_awesome.png',
+                               'alt' => wfMessage( 'bookmanagerv2-contents' 
)->text(),
+                               'title' => wfMessage( 'bookmanagerv2-contents' 
)->text()
                        ), '' );
                $html[] = Html::closeElement( 'a' );
                if ( $prev ) {
                        $linkContents = array();
                    $linkContents[] = Html::element( 'img', array(
                                        'class' => 'mw-bookmanagerv2-nav-prev',
-                                       'src' => $imagePath . 
'Angle_left_font_awesome.png'
+                                       'src' => $imagePath . 
'Angle_left_font_awesome.png',
+                                       'alt' => null,
+                                       'title' => null
                                ), '' );
                        $linkContents[] = $prev->title;
                        $html[] = Linker::link(
@@ -84,7 +90,9 @@
                    $linkContents[] = $next->title;
                        $linkContents[] = Html::element( 'img', array(
                                        'class' => 'mw-bookmanagerv2-nav-next',
-                                       'src' => $imagePath . 
'Angle_right_font_awesome.png'
+                                       'src' => $imagePath . 
'Angle_right_font_awesome.png',
+                                       'alt' => null,
+                                       'title' => null
                                ), '' );
                        $html[] = Linker::link(
                                Title::newFromText( $next->link ),
diff --git a/BookManagerv2.i18n.php b/BookManagerv2.i18n.php
index ea3934d..98435a7 100644
--- a/BookManagerv2.i18n.php
+++ b/BookManagerv2.i18n.php
@@ -16,6 +16,8 @@
        'bookmanagerv2-desc' => 'Adds functionality to enter and store book 
metadata and structure',
        'bookmanagerv2-invalid-json' => 'Invalid JSON',
        'bookmanagerv2-example-nav' => 'The navigation bar on this page is 
appearing because $wgBookManagerv2ExampleNavigation is set to true in 
LocalSettings.php.',
+       'bookmanagerv2-metadata' => 'Metadata',
+       'bookmanagerv2-contents' => 'Contents',
        'bookmanagerv2-title' => 'Title: $1',
        'bookmanagerv2-alternate-titles' => '{{PLURAL:$1|Alternate 
title|Alternate titles}}: $2',
        'bookmanagerv2-authors' => '{{PLURAL:$1|Author|Authors}}: $2',
@@ -49,6 +51,8 @@
        'bookmanagerv2-invalid-json' => 'Error message shown when an editor 
tries to save an invalid JSON block.
        {{Identical|Invalid JSON}}',
        'bookmanagerv2-example-nav' => 'Message shown in the subtitle to 
explain why example navigation bars are appearing. The navigation bars appear 
on every page when $wgBookManagerv2ExampleNavigation is set to true; if it\'s 
disabled in LocalSettings.php, they will disappear.',
+       'bookmanagerv2-metadata' => 'Alternate text for the navigation bar\'s 
metadata icon.',
+       'bookmanagerv2-contents' => 'Alternate text for the navigation bar\'s 
table of contents icon.',
        'bookmanagerv2-title' => 'Label in the navigation bar metadata 
dropdown. See screenshot for an example of this dropdown.
 [[File:BookManagerv2 navigation bar metadata dropdown.png]]
 {{Identical|Title}}',
diff --git a/modules/ext.BookManagerv2.css b/modules/ext.BookManagerv2.css
index 3b6d820..42ce451 100644
--- a/modules/ext.BookManagerv2.css
+++ b/modules/ext.BookManagerv2.css
@@ -31,10 +31,6 @@
        border-radius: 5px;
        padding: 3px 5px;
 }
-.mw-bookmanagerv2-nav-bar p {
-       margin: 5px 0;
-       padding: 0;
-}
 .mw-bookmanagerv2-nav-bar ol {
        padding-left: 30px;
 }
@@ -44,20 +40,16 @@
 }
 a.mw-bookmanagerv2-nav-icon, a.mw-bookmanagerv2-nav-icon img {
        display: inline;
-       vertical-align: middle;
        cursor: pointer;
 }
-.mw-bookmanagerv2-nav-bar img {
-       margin: 0 10px 2px 10px;
-}
-img.mw-bookmanagerv2-nav-data {
-       margin-left: 5px;
-}
-img.mw-bookmanagerv2-nav-next {
-       margin-right: 5px;
+a.mw-bookmanagerv2-nav-icon {
+       margin: 0 10px;
 }
 a.mw-bookmanagerv2-nav-prev {
-       margin-right: 20px;
+       margin-right: 10px;
+}
+a.mw-bookmanagerv2-nav-next {
+       margin-left: 10px;
 }
 div.mw-bookmanagerv2-nav-dropdown {
        display: none;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3e819b345be02d90610f7c92a65a47317f0f41b4
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