r55502 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r55501‎ | r55502 | r55503 >
Date:20:35, 22 August 2009
Author:ialex
Status:deferred
Tags:
Comment:
use ScriptLoader in OnlineStatus
Modified paths:
  • /trunk/extensions/OnlineStatus/OnlineStatus.php (modified) (history)

Diff [purge]

Index: trunk/extensions/OnlineStatus/OnlineStatus.php
@@ -41,6 +41,9 @@
4242 $wgExtensionMessagesFiles['OnlineStatus'] = dirname( __FILE__ ) . '/OnlineStatus.i18n.php';
4343 $wgExtensionMessagesFiles['OnlineStatusMagic'] = dirname( __FILE__ ) . '/OnlineStatus.i18n.magic.php';
4444
 45+// Script loader
 46+$wgJSAutoloadClasses['OnlineStatus'] = "extensions/OnlineStatus/OnlineStatus.js";
 47+
4548 // FIXME: Should be a separate class file
4649 class OnlineStatus {
4750 // FIXME: Can't this just be in the core bit instead of the class? The init() will not have to be called
@@ -273,8 +276,8 @@
274277 global $wgUseAjax;
275278
276279 if( $wgUser->isLoggedIn() && $wgUseAjax ){
277 - global $wgScriptPath, $wgJsMimeType;
278 - $out->addScript( "<script type=\"{$wgJsMimeType}\" src=\"{$wgScriptPath}/extensions/OnlineStatus/OnlineStatus.js\"></script>" );
 280+ global $wgScriptPath;
 281+ $out->addScriptClass( 'OnlineStatus' );
279282 $out->addExtensionStyle( "{$wgScriptPath}/extensions/OnlineStatus/OnlineStatus.css" );
280283 }
281284

Follow-up revisions

RevisionCommit summaryAuthorDate
r55504bump version per r55502ialex21:27, 22 August 2009

Status & tagging log