r95960 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r95959‎ | r95960 | r95961 >
Date:10:38, 1 September 2011
Author:krinkle
Status:ok (Comments)
Tags:
Comment:
Split up TablePager css class, introduce .mw-datatable
* All tables generated with the TablePager PHP class use this css class for their styling. This visual look has since inspired several templates and other tables on the wikis and in extensions to present data with row-highlighting functionality. To make it easier to do that, separating the generic styling into a new css class "mw-datatable" and use it in the TablePager PHP class.
* Kept pager-specific "min-width" rule under .TablePager
* Other CSS classes for TablePager are also untouched
* Changed table-heading color slightly to not be exactly the same as the hover-style (design/usability)
Modified paths:
  • /trunk/phase3/includes/Pager.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialAllmessages.php (modified) (history)
  • /trunk/phase3/skins/common/shared.css (modified) (history)

Diff [purge]

Index: trunk/phase3/skins/common/shared.css
@@ -573,16 +573,37 @@
574574 }
575575
576576 /**
577 - * Table pager (e.g. Special:ListFiles)
578 - * - remove underlines from the navigation link
579 - * - collapse borders
580 - * - set the borders to outsets (similar to Special:AllMessages)
581 - * - remove line wrapping for all td and th, set background color
582 - * - restore line wrapping for the last two table cells (description and size)
 577+ * Data table style
 578+ *
 579+ * Transparent table with suddle borders
 580+ * and blue row-highlighting.
583581 */
 582+.mw-datatable {
 583+ border-collapse: collapse;
 584+}
 585+.mw-datatable,
 586+.mw-datatable td,
 587+.mw-datatable th {
 588+ border: 1px solid #aaaaaa;
 589+ padding: 0 0.15em 0 0.15em;
 590+}
 591+.mw-datatable th {
 592+ background-color: #ddddff;
 593+}
 594+.mw-datatable td {
 595+ background-color: #ffffff;
 596+}
 597+.mw-datatable tr:hover td {
 598+ background-color: #eeeeff;
 599+}
 600+
 601+
 602+/**
 603+ * TablePager tables generated by the TablePager PHP class
 604+ * in MediaWiki (e.g. Special:ListFiles).
 605+ */
584606 .TablePager {
585607 min-width: 80%;
586 - border-collapse: collapse;
587608 }
588609 .TablePager_nav {
589610 margin: 0 auto;
@@ -594,21 +615,6 @@
595616 .TablePager_nav a {
596617 text-decoration: none;
597618 }
598 -.TablePager,
599 -.TablePager td,
600 -.TablePager th {
601 - border: 1px solid #aaaaaa;
602 - padding: 0 0.15em 0 0.15em;
603 -}
604 -.TablePager th {
605 - background-color: #eeeeff;
606 -}
607 -.TablePager td {
608 - background-color: #ffffff;
609 -}
610 -.TablePager tr:hover td {
611 - background-color: #eeeeff;
612 -}
613619
614620 .imagelist td,
615621 .imagelist th {
Index: trunk/phase3/includes/specials/SpecialAllmessages.php
@@ -319,7 +319,7 @@
320320 }
321321
322322 function getStartBody() {
323 - return Xml::openElement( 'table', array( 'class' => 'TablePager', 'id' => 'mw-allmessagestable' ) ) . "\n" .
 323+ return Xml::openElement( 'table', array( 'class' => 'mw-datatable TablePager', 'id' => 'mw-allmessagestable' ) ) . "\n" .
324324 "<thead><tr>
325325 <th rowspan=\"2\">" .
326326 wfMsg( 'allmessagesname' ) . "
Index: trunk/phase3/includes/Pager.php
@@ -821,7 +821,7 @@
822822 $tableClass = htmlspecialchars( $this->getTableClass() );
823823 $sortClass = htmlspecialchars( $this->getSortHeaderClass() );
824824
825 - $s = "<table style='border:1;' class=\"$tableClass\"><thead><tr>\n";
 825+ $s = "<table style='border:1;' class=\"mw-datatable $tableClass\"><thead><tr>\n";
826826 $fields = $this->getFieldNames();
827827
828828 # Make table header

Follow-up revisions

RevisionCommit summaryAuthorDate
r95961* addModuleStyles instead of addModule, support noscript-env...krinkle10:50, 1 September 2011
r95968Use .mw-datatable where TablePager is used in extensions....krinkle12:11, 1 September 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r95818[ResourceLoader2]: Initial go at the GadgetManager....krinkle22:25, 30 August 2011

Comments

#Comment by Nikerabbit (talk | contribs)   14:35, 1 September 2011

No suddle in my dictionary, did you mean subtle?

Status & tagging log