r95507 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r95506‎ | r95507 | r95508 >
Date:19:48, 25 August 2011
Author:ashley
Status:ok
Tags:
Comment:
SocialProfile: initial work related to bug #29984: load UpdateProfile.js in the top so that the call to the JS displaySection() function works in MW 1.18(+)
Modified paths:
  • /trunk/extensions/SocialProfile/UserProfile/SpecialEditProfile.php (modified) (history)
  • /trunk/extensions/SocialProfile/UserProfile/SpecialUpdateProfile.php (modified) (history)
  • /trunk/extensions/SocialProfile/UserProfile/UserProfile.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SocialProfile/UserProfile/UserProfile.php
@@ -28,6 +28,16 @@
2929 $wgGroupPermissions['sysop']['avatarremove'] = true;
3030 $wgGroupPermissions['staff']['editothersprofiles'] = true;
3131
 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+
3242 # Add new log types for profile edits and avatar uploads
3343 global $wgLogTypes, $wgLogNames, $wgLogHeaders, $wgLogActions;
3444 $wgLogTypes[] = 'profile';
Index: trunk/extensions/SocialProfile/UserProfile/SpecialUpdateProfile.php
@@ -80,7 +80,11 @@
8181
8282 // Add CSS & JS
8383 $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+ }
8589
8690 if ( $wgRequest->wasPosted() ) {
8791 if ( !$section ) {
Index: trunk/extensions/SocialProfile/UserProfile/SpecialEditProfile.php
@@ -55,7 +55,11 @@
5656
5757 // Add CSS & JS
5858 $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+ }
6064
6165 // Get the user's name from the wpUser URL parameter
6266 $userFromRequest = $wgRequest->getText( 'wpUser' );

Status & tagging log