r80776 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r80775‎ | r80776 | r80777 >
Date:22:46, 22 January 2011
Author:hartman
Status:ok (Comments)
Tags:
Comment:
Port Modern to resourceloader

Refs bug 26649
Modified paths:
  • /trunk/phase3/resources/Resources.php (modified) (history)
  • /trunk/phase3/skins/Modern.php (modified) (history)
  • /trunk/phase3/skins/modern/main.css (modified) (history)

Diff [purge]

Index: trunk/phase3/skins/modern/main.css
@@ -8,6 +8,9 @@
99 font-family: sans-serif;
1010 color: black;
1111 background-color: #f0f0f0;
 12+
 13+ direction: ltr;
 14+ unicode-bidi: embed;
1215 }
1316
1417 #mw_main,
@@ -182,6 +185,7 @@
183186 }
184187
185188 ul {
 189+ /* @embed */
186190 list-style-image: url(bullet.gif);
187191 }
188192
@@ -245,6 +249,7 @@
246250
247251 #footer {
248252 background-color: #f0f0f0;
 253+ /* @embed */
249254 background: url(footer-grad.png) repeat-x 0 0;
250255 padding: 10px 1em 1em 1em;
251256 clear:both;
@@ -407,31 +412,37 @@
408413
409414 #mw_content a.external,
410415 #mw_content a[href ^="gopher://"] {
 416+ /* @embed */
411417 background: url(external.png) center right no-repeat;
412418 padding-right: 13px;
413419 }
414420 #mw_content a[href ^="https://"],
415421 .link-https {
 422+ /* @embed */
416423 background: url(lock_icon.gif) center right no-repeat;
417424 padding-right: 16px;
418425 }
419426 #mw_content a[href ^="mailto:"],
420427 .link-mailto {
 428+ /* @embed */
421429 background: url(mail_icon.gif) center right no-repeat;
422430 padding-right: 18px;
423431 }
424432 #mw_content a[href ^="news://"] {
 433+ /* @embed */
425434 background: url(news_icon.png) center right no-repeat;
426435 padding-right: 18px;
427436 }
428437 #mw_content a[href ^="ftp://"],
429438 .link-ftp {
 439+ /* @embed */
430440 background: url(file_icon.gif) center right no-repeat;
431441 padding-right: 18px;
432442 }
433443 #mw_content a[href ^="irc://"],
434444 #mw_content a.extiw[href ^="irc://"],
435445 .link-irc {
 446+ /* @embed */
436447 background: url(discussionitem_icon.gif) center right no-repeat;
437448 padding-right: 18px;
438449 }
@@ -443,6 +454,7 @@
444455 #mw_content a.external[href $=".wav"], #mw_content a.external[href $=".WAV"],
445456 #mw_content a.external[href $=".wma"], #mw_content a.external[href $=".WMA"],
446457 .link-audio {
 458+ /* @embed */
447459 background: url("audio.png") center right no-repeat;
448460 padding-right: 13px;
449461 }
@@ -451,6 +463,7 @@
452464 #mw_content a.external[href $=".mpeg"], #mw_content a.external[href $=".MPEG"],
453465 #mw_content a.external[href $=".mpg"], #mw_content a.external[href $=".MPG"],
454466 .link-video {
 467+ /* @embed */
455468 background: url("video.png") center right no-repeat;
456469 padding-right: 13px;
457470 }
@@ -458,11 +471,13 @@
459472 #mw_content a.external[href *=".pdf#"], #mw_content a.external[href *=".PDF#"],
460473 #mw_content a.external[href *=".pdf?"], #mw_content a.external[href *=".PDF?"],
461474 .link-document {
 475+ /* @embed */
462476 background: url("document.png") center right no-repeat;
463477 padding-right: 12px;
464478 }
465479
466480 /* images */
 481+/* @noflip */
467482 div.floatright, table.floatright {
468483 clear: right;
469484 float: right;
@@ -475,6 +490,7 @@
476491 */
477492 }
478493 div.floatright p { font-style: italic; }
 494+/* @noflip */
479495 div.floatleft, table.floatleft {
480496 float: left;
481497 clear: left;
@@ -521,11 +537,13 @@
522538 border: none !important;
523539 background: none !important;
524540 }
 541+/* @noflip */
525542 div.tright {
526543 clear: right;
527544 float: right;
528545 margin: .5em 0 .8em 1.4em;
529546 }
 547+/* @noflip */
530548 div.tleft {
531549 float: left;
532550 clear: left;
@@ -793,6 +811,7 @@
794812 list-style-type: square;
795813 margin: .3em 0 0 1.5em;
796814 padding: 0;
 815+ /* @embed */
797816 list-style-image: url(bullet.gif);
798817 }
799818 ol {
@@ -836,6 +855,7 @@
837856 border-collapse: collapse;
838857 margin: 0 -1em 1em -1em;
839858 padding: 0 0 8px 0;
 859+ /* @embed */
840860 background: url(footer-grad.png) repeat-x bottom left;
841861 }
842862
@@ -880,4 +900,4 @@
881901 /* Tooltips are outside of the normal body code, so this helps make the size of the text sensible */
882902 .tipsy {
883903 font-size: 130%;
884 -}
\ No newline at end of file
 904+}
Index: trunk/phase3/skins/Modern.php
@@ -22,11 +22,8 @@
2323 $template = 'ModernTemplate', $useHeadElement = true;
2424
2525 function setupSkinUserCss( OutputPage $out ){
26 - // Do not call parent::setupSkinUserCss(), we have our own print style
27 - $out->addStyle( 'common/shared.css', 'screen' );
28 - $out->addStyle( 'modern/main.css', 'screen' );
29 - $out->addStyle( 'modern/print.css', 'print' );
30 - $out->addStyle( 'modern/rtl.css', 'screen', '', 'rtl' );
 26+ parent::setupSkinUserCss( $out );
 27+ $out->addModuleStyles ('skins.modern');
3128 }
3229 }
3330
Index: trunk/phase3/resources/Resources.php
@@ -27,6 +27,10 @@
2828 'skins.chick' => array(
2929 'styles' => array( 'skins/chick/main.css' => array( 'media' => 'screen,handheld' ) ),
3030 ),
 31+ 'skins.modern' => array(
 32+ 'styles' => array( 'skins/modern/main.css' => array( 'media' => 'screen' ),
 33+ 'skins/modern/print.css' => array( 'media' => 'print' ) ),
 34+ ),
3135
3236 /* jQuery */
3337

Follow-up revisions

RevisionCommit summaryAuthorDate
r80785Port the remaining Skin.php skins standard(classic), Cologneblue and Nostalgia...hartman01:41, 23 January 2011
r80928port rtl specific parts of modern RTL css to main.css...hartman22:05, 24 January 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r80771Finish porting the Simple skin to resourceloader....hartman21:16, 22 January 2011

Comments

#Comment by Krinkle (talk | contribs)   22:56, 22 January 2011
-		$out->addStyle( 'modern/rtl.css', 'screen', '', 'rtl' );

is rtl.css by default loaded for skins ResourceLoader ? The file exists and has some styles in it. If rtl is not loaded by default (which I think it's not, but then again RL isn't fully documented), it should either be merged or deleted.

#Comment by TheDJ (talk | contribs)   10:51, 23 January 2011

As mentioned in bug 26649, all these rtl stylesheets are now mostly redundant. However, some of their definitions are still useful, especially the hacks to make lists work better under older gecko versions. I intend to talk to Trevor and Roan about what we are gonna do with this truly rtl specific css.

Perhaps just integrate as .rtl with noflip ?

#Comment by Catrope (talk | contribs)   17:55, 24 January 2011

rtl.css files are not loaded by default, no. Redundant rules that are just flipped versions of LTR rules should be deleted. "True" RTL rules should be integrated with .rtl and noflip, as you said.

Status & tagging log