r113482 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r113481‎ | r113482 | r113483 >
Date:16:57, 9 March 2012
Author:j
Status:reverted
Tags:
Comment:
set remoteExtPath, extensions url might be different, this fixes resource loading issues on labs
Modified paths:
  • /trunk/extensions/MwEmbedSupport/MwEmbedResourceManager.php (modified) (history)
  • /trunk/extensions/MwEmbedSupport/MwEmbedSupport.hooks.php (modified) (history)

Diff [purge]

Index: trunk/extensions/MwEmbedSupport/MwEmbedSupport.hooks.php
@@ -10,7 +10,7 @@
1111 class MwEmbedSupportHooks {
1212 // Register MwEmbedSupport Hooks
1313 static function register(){
14 - global $wgHooks;
 14+ global $wgHooks $wgResourceModules;
1515 // Register the core MwEmbed Support Module:
1616 MwEmbedResourceManager::register( 'extensions/MwEmbedSupport/MwEmbedModules/MwEmbedSupport' );
1717
@@ -28,6 +28,11 @@
2929
3030 // Add the startup modules hook
3131 $wgHooks['ResourceLoaderGetStartupModules'][] = 'MwEmbedSupportHooks::addStartupModules';
 32+ $wgResourceModules['ext.MwEmbedSupport'] = array(
 33+ 'styles' => 'MwEmbedModules/MwEmbedSupport/skins/common/MwEmbedCommonStyle.css',
 34+ 'localBasePath' => dirname( __FILE__ ),
 35+ 'remoteExtPath' => 'MwEmbedSupport',
 36+ );
3237 return true;
3338 }
3439
@@ -46,4 +51,4 @@
4752 array_push($modules, 'jquery.triggerQueueCallback', 'jquery.loadingSpinner', 'jquery.mwEmbedUtil', 'mw.MwEmbedSupport' );
4853 return true;
4954 }
50 -}
\ No newline at end of file
 55+}
Index: trunk/extensions/MwEmbedSupport/MwEmbedResourceManager.php
@@ -94,6 +94,9 @@
9595 // Register all the resources with the resource loader
9696 foreach( self::$moduleSet as $path => $modules ) {
9797 foreach ( $modules as $name => $resources ) {
 98+ //remove 'extension' prefix from path
 99+ $resources['remoteExtPath'] = implode( '/', array_shift(explode( '/', $path )));
 100+
98101 // Register the resource with MwEmbed extended class if in standAlone resource loader mode:
99102 if( $wgEnableMwEmbedStandAlone === true ){
100103 $resourceLoader->register(
@@ -112,4 +115,4 @@
113116 // Continue module processing
114117 return true;
115118 }
116 -}
\ No newline at end of file
 119+}

Follow-up revisions

RevisionCommit summaryAuthorDate
r113483revert changes accidentally commited in r113482j17:00, 9 March 2012

Status & tagging log