https://www.mediawiki.org/wiki/Special:Code/MediaWiki/108345
Revision: 108345
Author: krinkle
Date: 2012-01-08 01:49:06 +0000 (Sun, 08 Jan 2012)
Log Message:
-----------
[Skin] Add CSS hook for action ("action-.." class on body)
* Fixes bug 4438
* Depends on r108342. See also r108343 which did a similar thing for mw.config
wgAction
Previously attempted in r91871, which was reverted in r94131.
Added in OutputPage instead of Skin::getPageClasses, as this is not directly
page nor skin related. It also ensures independency from skins, this CSS class
should be always available so that it can be relied on by the front-end.
Modified Paths:
--------------
trunk/phase3/RELEASE-NOTES-1.19
trunk/phase3/includes/OutputPage.php
Modified: trunk/phase3/RELEASE-NOTES-1.19
===================================================================
--- trunk/phase3/RELEASE-NOTES-1.19 2012-01-08 01:41:21 UTC (rev 108344)
+++ trunk/phase3/RELEASE-NOTES-1.19 2012-01-08 01:49:06 UTC (rev 108345)
@@ -231,6 +231,7 @@
* (bug 33587) Remove action "historysubmit" from history pages.
* (bug 25800) mw.config wgAction should contain the actually performed action
instead
of whatever the query value contains.
+* (bug 4438) Add CSS hook for current WikiPage action.
=== API changes in 1.19 ===
* (bug 19838) siprop=interwikimap can now use the interwiki cache.
Modified: trunk/phase3/includes/OutputPage.php
===================================================================
--- trunk/phase3/includes/OutputPage.php 2012-01-08 01:41:21 UTC (rev
108344)
+++ trunk/phase3/includes/OutputPage.php 2012-01-08 01:49:06 UTC (rev
108345)
@@ -2380,7 +2380,8 @@
* @return String: The doctype, opening <html>, and head element.
*/
public function headElement( Skin $sk, $includeStyle = true ) {
- global $wgContLang;
+ global $wgContLang, $mediaWiki;
+
$userdir = $this->getLanguage()->getDir();
$sitedir = $wgContLang->getDir();
@@ -2425,6 +2426,7 @@
}
$bodyAttrs['class'] .= ' ' . $sk->getPageClasses(
$this->getTitle() );
$bodyAttrs['class'] .= ' skin-' . Sanitizer::escapeClass(
$sk->getSkinName() );
+ $bodyAttrs['class'] .= ' action-' . Sanitizer::escapeClass(
$mediaWiki->getPerformedAction() );
$sk->addToBodyAttributes( $this, $bodyAttrs ); // Allow skins
to add body attributes they need
wfRunHooks( 'OutputPageBodyAttributes', array( $this, $sk,
&$bodyAttrs ) );
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs