* The al_title class was unused, and thus removed.
* The allmessages-customised class was used in CSS to target
elements with 'al_default' and 'al_actual' classses within it,
which are in turn only used for that purpose.
Change the HTML to match the needs of the CSS by only setting
al_default/al_actual classes on customised messages and remove
need for the parent element class.
On a plain install this reduced output by ~2K from 75.8K to 74.0K,
and allocate 100 (2x50) fewer attribute nodes.
Change-Id: If2dd4cf5c937935f03f30b8410a32b6821b0bf34
+ /** @return string HTML */
function formatRow( $row ) {
// Do all the normal stuff
$s = parent::formatRow( $row );
function formatRow( $row ) {
// Do all the normal stuff
$s = parent::formatRow( $row );
- 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 ) {
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' ];
+ }
'lang' => $this->lang->getHtmlCode(),
'dir' => $this->lang->getDir(),
'lang' => $this->lang->getHtmlCode(),
'dir' => $this->lang->getDir(),
+ if ( $this->mCurrentRow->am_customised ) {
+ // CSS class: am_default, am_actual
+ $attr += [ 'class' => $field ];
+ }
}
// This is not actually used, as getStartBody is overridden above
}
// This is not actually used, as getStartBody is overridden above
/* Special:AllMessages */
/* Special:AllMessages */
-#mw-allmessagestable .allmessages-customised .am_default {
+#mw-allmessagestable .am_default {
background-color: #fcffc4;
}
background-color: #fcffc4;
}
-#mw-allmessagestable .allmessages-customised:hover .am_default {
+#mw-allmessagestable tr:hover .am_default {
background-color: #faff90;
}
background-color: #faff90;
}
background-color: #e2ffe2;
}
background-color: #e2ffe2;
}
-#mw-allmessagestable .allmessages-customised:hover + .allmessages-customised .am_actual {
+#mw-allmessagestable tr:hover + tr .am_actual {
background-color: #b1ffb1;
}
background-color: #b1ffb1;
}