r106214 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r106213‎ | r106214 | r106215 >
Date:17:43, 14 December 2011
Author:cervidae
Status:ok
Tags:
Comment:
Fixing minor things
Modified paths:
  • /trunk/extensions/SharedCssJs/SharedCssJs.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SharedCssJs/SharedCssJs.php
@@ -20,7 +20,7 @@
2121 'path' => __FILE__,
2222 'name' => 'SharedCssJs',
2323 'author' => array( "Tim Weyer" ),
24 - 'version' => '1.0',
 24+ 'version' => '1.0.1',
2525 'url' => 'https://www.mediawiki.org/wiki/Extension:SharedCssJs',
2626 'descriptionmsg' => 'sharedcssjs-desc',
2727 );
@@ -30,8 +30,7 @@
3131 $wgExtensionMessagesFiles['SharedCssJs'] = $dir . 'SharedCssJs.i18n.php';
3232
3333 // Loading page protector
34 -$dir = dirname( __FILE__ ) . '/';
35 -require_once ( "$dir/SharedCssJsProtector.php" );
 34+require_once ( $dir . 'SharedCssJsProtector.php' );
3635
3736 // Hooks
3837 $wgHooks['SkinTemplateSetupPageCss'][] = 'wfSharedCSS';
@@ -39,7 +38,7 @@
4039 $wgHooks['BeforePageDisplay'][] = 'wfSharedJS';
4140 $wgHooks['BeforePageDisplay'][] = 'wfSharedUserJS';
4241
43 -function wfSharedCSS( &$out ) {
 42+function wfSharedCSS( &$globalcss ) {
4443 global $wgDisableSharedCSS, $wgSharedCssJsUrl;
4544 if( !empty( $wgDisableSharedCSS ) ) {
4645 return true;
@@ -47,12 +46,12 @@
4847
4948 if ($wgSharedCssJsUrl) {
5049 $url = $wgSharedCssJsUrl;
51 - $out .= "@import \"{$url}?title=MediaWiki:Global.css&action=raw&ctype=text/css&smaxage=0\";";
 50+ $globalcss .= "@import \"{$url}?title=MediaWiki:Global.css&action=raw&ctype=text/css&smaxage=0\";";
5251 }
5352 return true;
5453 }
5554
56 -function wfSharedJS( &$out ) {
 55+function wfSharedJS( &$globaljs ) {
5756 global $wgDisableSharedJS, $wgJsMimeType, $wgSharedCssJsUrl;
5857 if( !empty( $wgDisableSharedJS ) ) {
5958 return true;
@@ -60,12 +59,12 @@
6160
6261 if ($wgSharedCssJsUrl) {
6362 $url = $wgSharedCssJsUrl;
64 - $out->addScript("<script type=\"{$wgJsMimeType}\" src=\"{$url}?title=MediaWiki:Global.js&action=raw&ctype={$wgJsMimeType}\"></script>");
 63+ $globaljs->addScript("<script type=\"{$wgJsMimeType}\" src=\"{$url}?title=MediaWiki:Global.js&action=raw&ctype={$wgJsMimeType}\"></script>");
6564 }
6665 return true;
6766 }
6867
69 -function wfSharedUserCSS( &$out ) {
 68+function wfSharedUserCSS( &$globalusercss ) {
7069 global $wgDisableSharedUserCSS, $wgSharedCssJsUrl, $wgUser;
7170 if( !empty( $wgDisableSharedUserCSS ) || !isset( $wgSharedCssJsUrl ) ) {
7271 return true;
@@ -74,12 +73,12 @@
7574 if (!$wgUser->isAnon()) {
7675 $url = $wgSharedCssJsUrl;
7776 $userName = str_replace(' ', '_', $wgUser->getName());
78 - $out .= "@import \"{$url}?title=User:{$userName}/global.css&action=raw&ctype=text/css&smaxage=0\";";
 77+ $globalusercss .= "@import \"{$url}?title=User:{$userName}/global.css&action=raw&ctype=text/css&smaxage=0\";";
7978 }
8079 return true;
8180 }
8281
83 -function wfSharedUserJS( &$out ) {
 82+function wfSharedUserJS( &$globaluserjs ) {
8483 global $wgDisableSharedUserJS, $wgJsMimeType, $wgSharedCssJsUrl, $wgUser;
8584 if( !empty( $wgDisableSharedUserJS ) || !isset( $wgSharedCssJsUrl ) ) {
8685 return true;
@@ -88,7 +87,7 @@
8988 if (!$wgUser->isAnon()) {
9089 $url = $wgSharedCssJsUrl;
9190 $userName = str_replace(' ', '_', $wgUser->getName());
92 - $out->addScript("<script type=\"{$wgJsMimeType}\" src=\"{$url}?title=User:{$userName}/global.js&action=raw&ctype={$wgJsMimeType}\"></script>");
 91+ $globaluserjs->addScript("<script type=\"{$wgJsMimeType}\" src=\"{$url}?title=User:{$userName}/global.js&action=raw&ctype={$wgJsMimeType}\"></script>");
9392 }
9493 return true;
9594 }

Status & tagging log