Index: trunk/phase3/includes/OutputPage.php |
— | — | @@ -2403,8 +2403,10 @@ |
2404 | 2404 | 'lang' => $this->getContext()->getLang()->getCode(), |
2405 | 2405 | 'debug' => ResourceLoader::inDebugMode() ? 'true' : 'false', |
2406 | 2406 | 'skin' => $this->getSkin()->getSkinName(), |
2407 | | - 'only' => $only, |
2408 | 2407 | ); |
| 2408 | + if ( $only !== ResourceLoaderModule::TYPE_COMBINED ) { |
| 2409 | + $baseQuery['only'] = $only; |
| 2410 | + } |
2409 | 2411 | // Propagate printable and handheld parameters if present |
2410 | 2412 | if ( $this->isPrintable() ) { |
2411 | 2413 | $baseQuery['printable'] = 1; |
— | — | @@ -2622,11 +2624,14 @@ |
2623 | 2625 | $scripts .= Html::inlineScript( "\n" . $this->getRequest()->getText( 'wpTextbox1' ) . "\n" ) . "\n"; |
2624 | 2626 | } else { |
2625 | 2627 | # @todo FIXME: This means that User:Me/Common.js doesn't load when previewing |
2626 | | - # User:Me/Vector.js, and vice versa (bug26283) |
2627 | | - $userScripts[] = 'user'; |
| 2628 | + # User:Me/Vector.js, and vice versa (bug 26283) |
| 2629 | + |
| 2630 | + // We can't do $userScripts[] = 'user'; because the user module would end up |
| 2631 | + // being wrapped in a closure, so load it raw like 'site' |
| 2632 | + $scripts .= $this->makeResourceLoaderLink( 'user', ResourceLoaderModule::TYPE_SCRIPTS ); |
2628 | 2633 | } |
2629 | 2634 | } |
2630 | | - $scripts .= $this->makeResourceLoaderLink( $userScripts, ResourceLoaderModule::TYPE_SCRIPTS ); |
| 2635 | + $scripts .= $this->makeResourceLoaderLink( $userScripts, ResourceLoaderModule::TYPE_COMBINED ); |
2631 | 2636 | |
2632 | 2637 | return $scripts; |
2633 | 2638 | } |
Index: trunk/phase3/includes/resourceloader/ResourceLoader.php |
— | — | @@ -549,8 +549,10 @@ |
550 | 550 | switch ( $context->getOnly() ) { |
551 | 551 | case 'scripts': |
552 | 552 | if ( is_string( $scripts ) ) { |
| 553 | + // Load scripts raw... |
553 | 554 | $out .= $scripts; |
554 | 555 | } elseif ( is_array( $scripts ) ) { |
| 556 | + // ...except when $scripts is an array of URLs |
555 | 557 | $out .= self::makeLoaderImplementScript( $name, $scripts, array(), array() ); |
556 | 558 | } |
557 | 559 | break; |
Index: trunk/phase3/includes/resourceloader/ResourceLoaderUserOptionsModule.php |
— | — | @@ -84,6 +84,8 @@ |
85 | 85 | * @return array |
86 | 86 | */ |
87 | 87 | public function getStyles( ResourceLoaderContext $context ) { |
| 88 | + // FIXME: This stuff should really be in its own module, because it gets double-loaded otherwise |
| 89 | + // (once through a <link>, once when embedded as JS) |
88 | 90 | global $wgAllowUserCssPrefs; |
89 | 91 | |
90 | 92 | if ( $wgAllowUserCssPrefs ) { |
— | — | @@ -129,4 +131,8 @@ |
130 | 132 | public function getGroup() { |
131 | 133 | return 'private'; |
132 | 134 | } |
| 135 | + |
| 136 | + public function getDependencies() { |
| 137 | + return array( 'mediawiki.user' ); |
| 138 | + } |
133 | 139 | } |
Index: trunk/phase3/includes/resourceloader/ResourceLoaderUserTokensModule.php |
— | — | @@ -60,4 +60,8 @@ |
61 | 61 | public function getGroup() { |
62 | 62 | return 'private'; |
63 | 63 | } |
| 64 | + |
| 65 | + public function getDependencies() { |
| 66 | + return array( 'mediawiki.user' ); |
| 67 | + } |
64 | 68 | } |