'lang' => $this->getContext()->getLang()->getCode(),
'debug' => ResourceLoader::inDebugMode() ? 'true' : 'false',
'skin' => $this->getSkin()->getSkinName(),
- 'only' => $only,
);
+ if ( $only !== ResourceLoaderModule::TYPE_COMBINED ) {
+ $baseQuery['only'] = $only;
+ }
// Propagate printable and handheld parameters if present
if ( $this->isPrintable() ) {
$baseQuery['printable'] = 1;
$scripts .= Html::inlineScript( "\n" . $this->getRequest()->getText( 'wpTextbox1' ) . "\n" ) . "\n";
} else {
# @todo FIXME: This means that User:Me/Common.js doesn't load when previewing
- # User:Me/Vector.js, and vice versa (bug26283)
- $userScripts[] = 'user';
+ # User:Me/Vector.js, and vice versa (bug 26283)
+
+ // We can't do $userScripts[] = 'user'; because the user module would end up
+ // being wrapped in a closure, so load it raw like 'site'
+ $scripts .= $this->makeResourceLoaderLink( 'user', ResourceLoaderModule::TYPE_SCRIPTS );
}
}
- $scripts .= $this->makeResourceLoaderLink( $userScripts, ResourceLoaderModule::TYPE_SCRIPTS );
+ $scripts .= $this->makeResourceLoaderLink( $userScripts, ResourceLoaderModule::TYPE_COMBINED );
return $scripts;
}
switch ( $context->getOnly() ) {
case 'scripts':
if ( is_string( $scripts ) ) {
+ // Load scripts raw...
$out .= $scripts;
} elseif ( is_array( $scripts ) ) {
+ // ...except when $scripts is an array of URLs
$out .= self::makeLoaderImplementScript( $name, $scripts, array(), array() );
}
break;
* @return array
*/
public function getStyles( ResourceLoaderContext $context ) {
+ // FIXME: This stuff should really be in its own module, because it gets double-loaded otherwise
+ // (once through a <link>, once when embedded as JS)
global $wgAllowUserCssPrefs;
if ( $wgAllowUserCssPrefs ) {
public function getGroup() {
return 'private';
}
+
+ public function getDependencies() {
+ return array( 'mediawiki.user' );
+ }
}