r49500 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r49499‎ | r49500 | r49501 >
Date:09:36, 15 April 2009
Author:raymond
Status:ok
Tags:
Comment:
* Special:AllPages: Move hardcoded styles from code to CSS
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/DefaultSettings.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialAllpages.php (modified) (history)
  • /trunk/phase3/skins/common/shared.css (modified) (history)
  • /trunk/phase3/skins/modern/rtl.css (modified) (history)
  • /trunk/phase3/skins/monobook/rtl.css (modified) (history)
  • /trunk/phase3/skins/simple/rtl.css (modified) (history)

Diff [purge]

Index: trunk/phase3/skins/monobook/rtl.css
@@ -240,6 +240,11 @@
241241 html > body div#bodyContent ul#filetoc {
242242 display: block;
243243 }
 244+
 245+/* Special:Allpages styling */
 246+td.mw-allpages-nav, p.mw-allpages-nav {
 247+ text-align: left;
 248+
244249 /* Special:Prefixindex styling */
245250 td#mw-prefixindex-nav-form {
246251 text-align: left;
Index: trunk/phase3/skins/modern/rtl.css
@@ -152,6 +152,10 @@
153153 display: block;
154154 }
155155
 156+/* Special:Allpages styling */
 157+td.mw-allpages-nav, p.mw-allpages-nav {
 158+ text-align: left;
 159+
156160 /* Special:Prefixindex styling */
157161 td#mw-prefixindex-nav-form {
158162 text-align: left;
Index: trunk/phase3/skins/common/shared.css
@@ -300,6 +300,23 @@
301301 font-weight: bold;
302302 }
303303
 304+/* Special:Allpages styling */
 305+table.allpageslist {
 306+ background-color: transparent;
 307+}
 308+table.mw-allpages-table-form, table.mw-allpages-table-chunk {
 309+ background-color: transparent;
 310+ width: 100%;
 311+}
 312+td.mw-allpages-nav, p.mw-allpages-nav {
 313+ text-align: right;
 314+ font-size: smaller;
 315+ margin-bottom: 1em;
 316+}
 317+table.mw-allpages-table-form tr {
 318+ vertical-align: top;
 319+}
 320+
304321 /* Special:Prefixindex styling */
305322 table#mw-prefixindex-list-table,
306323 table#mw-prefixindex-nav-table {
Index: trunk/phase3/skins/simple/rtl.css
@@ -174,6 +174,11 @@
175175 html > body div#bodyContent ul {
176176 display: table;
177177 }
 178+
 179+/* Special:Allpages styling */
 180+td.mw-allpages-nav, p.mw-allpages-nav {
 181+ text-align: left;
 182+
178183 /* Special:Prefixindex styling */
179184 td#mw-prefixindex-nav-form {
180185 text-align: left;
Index: trunk/phase3/includes/DefaultSettings.php
@@ -1477,7 +1477,7 @@
14781478 * to ensure that client-side caches don't keep obsolete copies of global
14791479 * styles.
14801480 */
1481 -$wgStyleVersion = '210';
 1481+$wgStyleVersion = '211';
14821482
14831483
14841484 # Server-side caching:
Index: trunk/phase3/includes/specials/SpecialAllpages.php
@@ -114,8 +114,7 @@
115115 * @param integer $namespace (default NS_MAIN)
116116 */
117117 function showToplevel( $namespace = NS_MAIN, $from = '', $to = '' ) {
118 - global $wgOut, $wgContLang;
119 - $align = $wgContLang->isRtl() ? 'left' : 'right';
 118+ global $wgOut;
120119
121120 # TODO: Either make this *much* faster or cache the title index points
122121 # in the querycache table.
@@ -198,13 +197,13 @@
199198 }
200199
201200 # At this point, $lines should contain an even number of elements.
202 - $out .= "<table class='allpageslist' style='background: inherit;'>";
 201+ $out .= Xml::openElement( 'table', array( 'class' => 'allpageslist' ) );
203202 while( count ( $lines ) > 0 ) {
204203 $inpoint = array_shift( $lines );
205204 $outpoint = array_shift( $lines );
206205 $out .= $this->showline( $inpoint, $outpoint, $namespace );
207206 }
208 - $out .= '</table>';
 207+ $out .= Xml::closeElement( 'table' );
209208 $nsForm = $this->namespaceForm( $namespace, $from, $to );
210209
211210 # Is there more?
@@ -213,11 +212,17 @@
214213 } else {
215214 if( isset($from) || isset($to) ) {
216215 global $wgUser;
217 - $out2 = '<table style="background: inherit;" width="100%" cellpadding="0" cellspacing="0" border="0">';
218 - $out2 .= '<tr valign="top"><td>' . $nsForm;
219 - $out2 .= '</td><td align="' . $align . '" style="font-size: smaller; margin-bottom: 1em;">' .
220 - $wgUser->getSkin()->makeKnownLinkObj( $this->getTitle(), wfMsgHtml ( 'allpages' ) );
221 - $out2 .= "</td></tr></table>";
 216+ $out2 = Xml::openElement( 'table', array( 'class' => 'mw-allpages-table-form' ) ).
 217+ '<tr>
 218+ <td>' .
 219+ $nsForm .
 220+ '</td>
 221+ <td class="mw-allpages-nav">' .
 222+ $wgUser->getSkin()->link( $this->getTitle(), wfMsgHtml ( 'allpages' ),
 223+ array(), array(), 'known' ) .
 224+ "</td>
 225+ </tr>" .
 226+ Xml::closeElement( 'table' );
222227 } else {
223228 $out2 = $nsForm;
224229 }
@@ -233,7 +238,6 @@
234239 */
235240 function showline( $inpoint, $outpoint, $namespace = NS_MAIN ) {
236241 global $wgContLang;
237 - $align = $wgContLang->isRtl() ? 'left' : 'right';
238242 $inpointf = htmlspecialchars( str_replace( '_', ' ', $inpoint ) );
239243 $outpointf = htmlspecialchars( str_replace( '_', ' ', $outpoint ) );
240244 // Don't let the length runaway
@@ -248,7 +252,7 @@
249253 "<a href=\"$link\">$inpointf</a></td><td>",
250254 "</td><td><a href=\"$link\">$outpointf</a>"
251255 );
252 - return '<tr><td align="' . $align . '">'.$out.'</td></tr>';
 256+ return '<tr><td class="mw-allpages-nav">' . $out . '</td></tr>';
253257 }
254258
255259 /**
@@ -264,8 +268,6 @@
265269 $fromList = $this->getNamespaceKeyAndText($namespace, $from);
266270 $toList = $this->getNamespaceKeyAndText( $namespace, $to );
267271 $namespaces = $wgContLang->getNamespaces();
268 - $align = $wgContLang->isRtl() ? 'left' : 'right';
269 -
270272 $n = 0;
271273
272274 if ( !$fromList || !$toList ) {
@@ -299,8 +301,7 @@
300302 );
301303
302304 if( $res->numRows() > 0 ) {
303 - $out = '<table style="background: inherit;" border="0" width="100%">';
304 -
 305+ $out = Xml::openElement( 'table', array( 'class' => 'mw-allpages-table-chunk' ) );
305306 while( ( $n < $this->maxPerPage ) && ( $s = $res->fetchObject() ) ) {
306307 $t = Title::makeTitle( $s->page_namespace, $s->page_title );
307308 if( $t ) {
@@ -316,13 +317,13 @@
317318 $out .= "<td width=\"33%\">$link</td>";
318319 $n++;
319320 if( $n % 3 == 0 ) {
320 - $out .= '</tr>';
 321+ $out .= "</tr>\n";
321322 }
322323 }
323324 if( ($n % 3) != 0 ) {
324 - $out .= '</tr>';
 325+ $out .= "</tr>\n";
325326 }
326 - $out .= '</table>';
 327+ $out .= Xml::closeElement( 'table' );
327328 } else {
328329 $out = '';
329330 }
@@ -370,11 +371,13 @@
371372 $self = $this->getTitle();
372373
373374 $nsForm = $this->namespaceForm( $namespace, $from, $to );
374 - $out2 = '<table style="background: inherit;" width="100%" cellpadding="0" cellspacing="0" border="0">';
375 - $out2 .= '<tr valign="top"><td>' . $nsForm;
376 - $out2 .= '</td><td align="' . $align . '" style="font-size: smaller; margin-bottom: 1em;">' .
377 - $sk->makeKnownLinkObj( $self,
378 - wfMsgHtml ( 'allpages' ) );
 375+ $out2 = Xml::openElement( 'table', array( 'class' => 'mw-allpages-table-form' ) ).
 376+ '<tr>
 377+ <td>' .
 378+ $nsForm .
 379+ '</td>
 380+ <td class="mw-allpages-nav">' .
 381+ $sk->link( $self, wfMsgHtml ( 'allpages' ), array(), array(), 'known' );
379382
380383 # Do we put a previous link ?
381384 if( isset( $prevTitle ) && $pt = $prevTitle->getText() ) {
@@ -399,7 +402,7 @@
400403
401404 $wgOut->addHTML( $out2 . $out );
402405 if( isset($prevLink) or isset($nextLink) ) {
403 - $wgOut->addHTML( '<hr /><p style="font-size: smaller; float: ' . $align . '">' );
 406+ $wgOut->addHTML( '<hr /><p class="mw-allpages-nav">' );
404407 if( isset( $prevLink ) ) {
405408 $wgOut->addHTML( $prevLink );
406409 }
Index: trunk/phase3/RELEASE-NOTES
@@ -164,6 +164,7 @@
165165 * Added new hook 'MessageCacheReplace' into MessageCache.php. For instance
166166 to allow extensions to update caches in similar way as MediaWiki invalidates
167167 a cached MonoBook sidebar
 168+* Special:AllPages: Move hardcoded styles from code to CSS
168169
169170 === Bug fixes in 1.15 ===
170171 * (bug 16968) Special:Upload no longer throws useless warnings.

Follow-up revisions

RevisionCommit summaryAuthorDate
r49501Follow up r49500: fix classnameraymond09:43, 15 April 2009
r49502Follow up r49500: add class from r49501 to the CSS files too.raymond09:49, 15 April 2009
r81177Removing more, no longer needed, overrides for the white table background (w...krinkle23:30, 28 January 2011

Status & tagging log