Index: trunk/extensions/OnlineStatus/OnlineStatus.php |
— | — | @@ -41,6 +41,9 @@ |
42 | 42 | $wgExtensionMessagesFiles['OnlineStatus'] = dirname( __FILE__ ) . '/OnlineStatus.i18n.php'; |
43 | 43 | $wgExtensionMessagesFiles['OnlineStatusMagic'] = dirname( __FILE__ ) . '/OnlineStatus.i18n.magic.php'; |
44 | 44 | |
| 45 | +// Script loader |
| 46 | +$wgJSAutoloadClasses['OnlineStatus'] = "extensions/OnlineStatus/OnlineStatus.js"; |
| 47 | + |
45 | 48 | // FIXME: Should be a separate class file |
46 | 49 | class OnlineStatus { |
47 | 50 | // 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 @@ |
274 | 277 | global $wgUseAjax; |
275 | 278 | |
276 | 279 | 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' ); |
279 | 282 | $out->addExtensionStyle( "{$wgScriptPath}/extensions/OnlineStatus/OnlineStatus.css" ); |
280 | 283 | } |
281 | 284 | |