r39058 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r39057‎ | r39058 | r39059 >
Date:09:22, 10 August 2008
Author:sql
Status:old
Tags:
Comment:
Try at fixing bug 15052 - Skins should add their name as a class in <body>
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/Skin.php (modified) (history)
  • /trunk/phase3/includes/SkinTemplate.php (modified) (history)
  • /trunk/phase3/skins/Modern.php (modified) (history)
  • /trunk/phase3/skins/MonoBook.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/SkinTemplate.php
@@ -193,6 +193,7 @@
194194 $tpl->set( 'displaytitle', $wgOut->mPageLinkTitle );
195195 $tpl->set( 'pageclass', Sanitizer::escapeClass( 'page-'.$this->mTitle->getPrefixedText() ) );
196196 $tpl->set( 'talkclass', ( $wgTitle->isTalkPage() ? "ns-talk" : ( $wgTitle->getNamespace() == NS_SPECIAL ? "ns-special" : "ns-subject" ) ) );
 197+ $tpl->set( 'skinnameclass', ( "skin-" . Sanitizer::escapeClass( $this->getSkinName ( ) ) ) );
197198
198199 $nsname = isset( $wgCanonicalNamespaceNames[ $this->mTitle->getNamespace() ] ) ?
199200 $wgCanonicalNamespaceNames[ $this->mTitle->getNamespace() ] :
Index: trunk/phase3/includes/Skin.php
@@ -591,7 +591,8 @@
592592 'mediawiki ns-'.$wgTitle->getNamespace().
593593 ' '.( $wgContLang->isRTL() ? "rtl" : "ltr" ).
594594 ' '.Sanitizer::escapeClass( 'page-'.$wgTitle->getPrefixedText() ).
595 - ' '.( $wgTitle->isTalkPage() ? "ns-talk" : ( $wgTitle->isTalkPage() ? "ns-talk" : ( $wgTitle->getNamespace() == NS_SPECIAL ? "ns-special" : "ns-subject" ) ) );
 595+ ' '.( $wgTitle->isTalkPage() ? "ns-talk" : ( $wgTitle->isTalkPage() ? "ns-talk" : ( $wgTitle->getNamespace() == NS_SPECIAL ? "ns-special" : "ns-subject" ) ) ).
 596+ ' skin-'. Sanitizer::escapeClass( $this->getSkinName( ) );
596597 return $a;
597598 }
598599
Index: trunk/phase3/RELEASE-NOTES
@@ -91,6 +91,7 @@
9292 allows having the unprefixed page title as the default category sortkey
9393 * (bug 15079) Add class="ns-talk" / "ns-subject" to <body>. Also added ns-special to
9494 special pages.
 95+* (bug 15052) Skins should add their name as a class in <body>
9596
9697 === API changes in 1.14 ===
9798
Index: trunk/phase3/skins/MonoBook.php
@@ -104,7 +104,7 @@
105105 </head>
106106 <body<?php if($this->data['body_ondblclick']) { ?> ondblclick="<?php $this->text('body_ondblclick') ?>"<?php } ?>
107107 <?php if($this->data['body_onload']) { ?> onload="<?php $this->text('body_onload') ?>"<?php } ?>
108 - class="mediawiki <?php $this->text('nsclass') ?> <?php $this->text('dir') ?> <?php $this->text('pageclass') ?> <?php $this->text('talkclass') ?>">
 108+ class="mediawiki <?php $this->text('nsclass') ?> <?php $this->text('dir') ?> <?php $this->text('pageclass') ?> <?php $this->text('talkclass') ?> <?php $this->text('skinnameclass') ?>">
109109 <div id="globalWrapper">
110110 <div id="column-content">
111111 <div id="content">
Index: trunk/phase3/skins/Modern.php
@@ -95,7 +95,7 @@
9696 </head>
9797 <body<?php if($this->data['body_ondblclick']) { ?> ondblclick="<?php $this->text('body_ondblclick') ?>"<?php } ?>
9898 <?php if($this->data['body_onload' ]) { ?> onload="<?php $this->text('body_onload') ?>"<?php } ?>
99 - class="mediawiki <?php $this->text('nsclass') ?> <?php $this->text('dir') ?> <?php $this->text('pageclass') ?> <?php $this->text('talkclass') ?>">
 99+ class="mediawiki <?php $this->text('nsclass') ?> <?php $this->text('dir') ?> <?php $this->text('pageclass') ?> <?php $this->text('talkclass') ?> <?php $this->text('skinnameclass') ?>">
100100
101101 <!-- heading -->
102102 <div id="mw_header"><h1 id="firstHeading"><?php $this->data['displaytitle']!=""?$this->html('title'):$this->text('title') ?></h1></div>

Follow-up revisions

RevisionCommit summaryAuthorDate
r39073Cleanup to r39058. Slightly less code than before. Same result :)demon16:48, 10 August 2008

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r38675(bug 15052) Skins should add their name as a class in <body>ashley01:07, 6 August 2008

Status & tagging log