Merge "Special:AllMessages: Remove al_title and allmessages-customised classes"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Mon, 17 Dec 2018 09:39:52 +0000 (09:39 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Mon, 17 Dec 2018 09:39:52 +0000 (09:39 +0000)
includes/specials/pagers/AllMessagesTablePager.php
resources/src/mediawiki.special/special.css

index a9479c4..18c1d70 100644 (file)
@@ -345,6 +345,7 @@ class AllMessagesTablePager extends TablePager {
                return '';
        }
 
+       /** @return string HTML */
        function formatRow( $row ) {
                // Do all the normal stuff
                $s = parent::formatRow( $row );
@@ -365,28 +366,28 @@ class AllMessagesTablePager extends TablePager {
                return $s;
        }
 
-       function getRowAttrs( $row, $isSecond = false ) {
-               $arr = [];
-
-               if ( $row->am_customised ) {
-                       $arr['class'] = 'allmessages-customised';
-               }
-
-               return $arr;
+       function getRowAttrs( $row ) {
+               return [];
        }
 
+       /** @return array HTML attributes */
        function getCellAttrs( $field, $value ) {
-               if ( $this->mCurrentRow->am_customised && $field === 'am_title' ) {
-                       return [ 'rowspan' => '2', 'class' => $field ];
-               } elseif ( $field === 'am_title' ) {
-                       return [ 'class' => $field ];
+               $attr = [];
+               if ( $field === 'am_title' ) {
+                       if ( $this->mCurrentRow->am_customised ) {
+                               $attr += [ 'rowspan' => '2' ];
+                       }
                } else {
-                       return [
+                       $attr += [
                                'lang' => $this->lang->getHtmlCode(),
                                'dir' => $this->lang->getDir(),
-                               'class' => $field
                        ];
+                       if ( $this->mCurrentRow->am_customised ) {
+                               // CSS class: am_default, am_actual
+                               $attr += [ 'class' => $field ];
+                       }
                }
+               return $attr;
        }
 
        // This is not actually used, as getStartBody is overridden above
index 35cdee7..cb05793 100644 (file)
@@ -1,9 +1,9 @@
 /* Special:AllMessages */
-#mw-allmessagestable .allmessages-customised .am_default {
+#mw-allmessagestable .am_default {
        background-color: #fcffc4;
 }
 
-#mw-allmessagestable .allmessages-customised:hover .am_default {
+#mw-allmessagestable tr:hover .am_default {
        background-color: #faff90;
 }
 
@@ -11,7 +11,7 @@
        background-color: #e2ffe2;
 }
 
-#mw-allmessagestable .allmessages-customised:hover + .allmessages-customised .am_actual {
+#mw-allmessagestable tr:hover + tr .am_actual {
        background-color: #b1ffb1;
 }