Mollywhite has submitted this change and it was merged.

Change subject: Whitespace cleanup, changing lists to use ordered list.
......................................................................


Whitespace cleanup, changing lists to use ordered list.

Removing trailing whitespace and whitespace in empty lines.
Changed <p> tags in the dropdown menus to <ol><li>.

Change-Id: I9941ae4048f7d416a5313c6fcfacc8c652e2dc93
---
M BookManagerv2.hooks.php
M modules/ext.BookManagerv2.css
M modules/ext.BookManagerv2.js
3 files changed, 28 insertions(+), 22 deletions(-)

Approvals:
  Mollywhite: Verified; Looks good to me, approved
  jenkins-bot: Checked



diff --git a/BookManagerv2.hooks.php b/BookManagerv2.hooks.php
index 868987d..65a497e 100644
--- a/BookManagerv2.hooks.php
+++ b/BookManagerv2.hooks.php
@@ -165,11 +165,11 @@
         * @return string HTML list item element
         */
        public static function addDate( $year, $month, $day ) {
-               //TODO: This needs to be localized.
+               // TODO: This needs to be localized.
                $output = array();
                $output[] = Html::openElement( 'li', array() );
                if ( $day && !$month ) {
-                       //Having a day without a month doesn't make much sense
+                       // Having a day without a month doesn't make much sense
                        $date = $year;
                } else {
                        $date = array();
@@ -222,7 +222,7 @@
                $metadata[] = Html::openElement( 'ul', array() );
                $metadata[] = Html::openElement( 'li', array() );
                $metadata[] = wfMessage( 'bookmanagerv2-title',
-                       $jsonBook->title)->text();
+                       $jsonBook->title )->text();
                $metadata[] = Html::closeElement( 'li' );
                if ( isset( $jsonBook->alternate_titles ) ) {
                        $metadata[] = self::addArray( "alternate-titles",
@@ -277,7 +277,7 @@
                        $metadata[] = self::addString( "printer", 
$jsonBook->printer );
                }
                if ( isset( $jsonBook->language ) ) {
-                       //TODO: Transform the language code to the correct 
long-form language
+                       // TODO: Transform the language code to the correct 
long-form language
                        $metadata[] = self::addString( "language", 
$jsonBook->language );
                }
                if ( isset( $jsonBook->description ) ) {
@@ -312,7 +312,7 @@
                                $categories = $out->getCategories();
                                $namespace = $wgContLang->convertNamespace( 
NS_BOOK ) . ":";
                                foreach ( $categories as $cat ) {
-                                       if ( substr( $cat, 0, 
strlen($namespace) ) === $namespace ) {
+                                       if ( substr( $cat, 0, strlen( 
$namespace ) ) === $namespace ) {
                                                $jsonPageTitle = 
Title::newFromText( $cat );
                                                $jsonBook = self::getJson( 
$jsonPageTitle );
                                                if ( $jsonBook ) {
@@ -321,7 +321,7 @@
                                                        $prev = (object) 
array();
                                                        $next = (object) 
array();
 
-                                                       //Get the previous/next 
pages
+                                                       // Get the 
previous/next pages
                                                        foreach ( 
$jsonBook->sections as $key => $val ) {
                                                                if ( $val->link 
=== $currentPageTitle ) {
                                                                        if ( 
$key !== 0 ) {
diff --git a/modules/ext.BookManagerv2.css b/modules/ext.BookManagerv2.css
index 7fdee0d..a19d7d6 100644
--- a/modules/ext.BookManagerv2.css
+++ b/modules/ext.BookManagerv2.css
@@ -31,7 +31,7 @@
        border-radius: 5px;
        padding: 3px 5px;
 }
-.mw-bookmanagerv2-nav-bar p { 
+.mw-bookmanagerv2-nav-bar p {
        margin: 5px 0;
        padding: 0;
 }
@@ -48,7 +48,7 @@
        cursor: pointer;
 }
 .mw-bookmanagerv2-nav-bar img {
-       margin: 0 10px 2px 10px; 
+       margin: 0 10px 2px 10px;
 }
 img.mw-bookmanagerv2-nav-data {
        margin-left: 5px;
@@ -94,7 +94,10 @@
        left: 50%;
        margin-left: -141px;
 }
-
+div.mw-bookmanagerv2-nav-dropdown ol, div.mw-bookmanagerv2-nav-dropdown ul {
+       list-style: none;
+       margin: 0;
+}
 div.mw-bookmanagerv2-nav-toc {
        margin-left: 45px;
 }
diff --git a/modules/ext.BookManagerv2.js b/modules/ext.BookManagerv2.js
index cfe946f..aca32d8 100644
--- a/modules/ext.BookManagerv2.js
+++ b/modules/ext.BookManagerv2.js
@@ -1,4 +1,4 @@
-/**
+ /**
  * @file
  * @section LICENSE
  * This program is free software; you can redistribute it and/or
@@ -16,17 +16,20 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, 
USA.
  **/
 
-$(function () {
-       $('a.mw-bookmanagerv2-nav-data').click( function() {
-               if ( $('div.mw-bookmanagerv2-nav-toc').is(':visible') ) {
-                       $('div.mw-bookmanagerv2-nav-toc').hide();
-               }
-               $('div.mw-bookmanagerv2-nav-data').toggle();
+(function ( $ ) {
+
+       // When the metadata icon is clicked, hide the table
+       // of contents dropdown and toggle the metadata one
+       $( 'a.mw-bookmanagerv2-nav-data' ).click( function () {
+               $( 'div.mw-bookmanagerv2-nav-toc' ).hide();
+               $( 'div.mw-bookmanagerv2-nav-data' ).toggle();
        });
-       $('a.mw-bookmanagerv2-nav-toc').click( function() {
-               if ( $('div.mw-bookmanagerv2-nav-data').is(':visible') ) {
-                       $('div.mw-bookmanagerv2-nav-data').hide();
-               }
-               $('div.mw-bookmanagerv2-nav-toc').toggle();
+
+       // When the contents icon is clicked, hide the metadata
+       // dropdown and toggle the table of contents one
+       $( 'a.mw-bookmanagerv2-nav-toc' ).click( function () {
+               $( 'div.mw-bookmanagerv2-nav-data' ).hide();
+               $( 'div.mw-bookmanagerv2-nav-toc' ).toggle();
        });
-});
+
+}(jQuery));

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I9941ae4048f7d416a5313c6fcfacc8c652e2dc93
Gerrit-PatchSet: 5
Gerrit-Project: mediawiki/extensions/BookManagerv2
Gerrit-Branch: master
Gerrit-Owner: Mollywhite <[email protected]>
Gerrit-Reviewer: Helder.wiki <[email protected]>
Gerrit-Reviewer: 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