Index: trunk/extensions/SocialProfile/UserProfile/UserProfile.php |
— | — | @@ -28,6 +28,16 @@ |
29 | 29 | $wgGroupPermissions['sysop']['avatarremove'] = true; |
30 | 30 | $wgGroupPermissions['staff']['editothersprofiles'] = true; |
31 | 31 | |
| 32 | +// ResourceLoader support for MediaWiki 1.17+ |
| 33 | +// Modules for Special:EditProfile/Special:UpdateProfile |
| 34 | +$wgResourceModules['ext.userProfile.updateProfile'] = array( |
| 35 | + 'styles' => 'UserProfile.css', |
| 36 | + 'scripts' => 'UpdateProfile.js', |
| 37 | + 'localBasePath' => dirname( __FILE__ ), |
| 38 | + 'remoteExtPath' => 'SocialProfile/UserProfile', |
| 39 | + 'position' => 'top' |
| 40 | +); |
| 41 | + |
32 | 42 | # Add new log types for profile edits and avatar uploads |
33 | 43 | global $wgLogTypes, $wgLogNames, $wgLogHeaders, $wgLogActions; |
34 | 44 | $wgLogTypes[] = 'profile'; |
Index: trunk/extensions/SocialProfile/UserProfile/SpecialUpdateProfile.php |
— | — | @@ -80,7 +80,11 @@ |
81 | 81 | |
82 | 82 | // Add CSS & JS |
83 | 83 | $wgOut->addExtensionStyle( $wgUserProfileScripts . '/UserProfile.css' ); |
84 | | - $wgOut->addScriptFile( $wgUserProfileScripts . '/UpdateProfile.js' ); |
| 84 | + if ( defined( 'MW_SUPPORTS_RESOURCE_MODULES' ) ) { |
| 85 | + $wgOut->addModuleScripts( 'ext.userProfile.updateProfile' ); |
| 86 | + } else { |
| 87 | + $wgOut->addScriptFile( $wgUserProfileScripts . '/UpdateProfile.js' ); |
| 88 | + } |
85 | 89 | |
86 | 90 | if ( $wgRequest->wasPosted() ) { |
87 | 91 | if ( !$section ) { |
Index: trunk/extensions/SocialProfile/UserProfile/SpecialEditProfile.php |
— | — | @@ -55,7 +55,11 @@ |
56 | 56 | |
57 | 57 | // Add CSS & JS |
58 | 58 | $wgOut->addExtensionStyle( $wgUserProfileScripts . '/UserProfile.css' ); |
59 | | - $wgOut->addScriptFile( $wgUserProfileScripts . '/UpdateProfile.js' ); |
| 59 | + if ( defined( 'MW_SUPPORTS_RESOURCE_MODULES' ) ) { |
| 60 | + $wgOut->addModuleScripts( 'ext.userProfile.updateProfile' ); |
| 61 | + } else { |
| 62 | + $wgOut->addScriptFile( $wgUserProfileScripts . '/UpdateProfile.js' ); |
| 63 | + } |
60 | 64 | |
61 | 65 | // Get the user's name from the wpUser URL parameter |
62 | 66 | $userFromRequest = $wgRequest->getText( 'wpUser' ); |