Index: trunk/extensions/Gadgets/Gadgets_body.php |
— | — | @@ -11,7 +11,7 @@ |
12 | 12 | * @license GNU General Public Licence 2.0 or later |
13 | 13 | */ |
14 | 14 | |
15 | | -class GadgetHooks { |
| 15 | +class GadgetHooks extends OutputPage { |
16 | 16 | /** |
17 | 17 | * ArticleSaveComplete hook handler. |
18 | 18 | * |
— | — | @@ -150,10 +150,12 @@ |
151 | 151 | $lb->setCaller( __METHOD__ ); |
152 | 152 | $pages = array(); |
153 | 153 | |
| 154 | + $styles = array(); |
154 | 155 | foreach ( $gadgets as $gadget ) { |
155 | 156 | if ( $gadget->isEnabled( $wgUser ) && $gadget->isAllowed( $wgUser ) ) { |
156 | 157 | if ( $gadget->hasModule() ) { |
157 | | - $out->addModules( $gadget->getModuleName() ); |
| 158 | + $styles[] = $gadget->getModuleName(); |
| 159 | + $out->addModuleScripts( $gadget->getModuleName() ); |
158 | 160 | } |
159 | 161 | |
160 | 162 | foreach ( $gadget->getLegacyScripts() as $page ) { |
— | — | @@ -162,6 +164,9 @@ |
163 | 165 | } |
164 | 166 | } |
165 | 167 | } |
| 168 | + $out->addHeadItem( 'ext.gadget', $out->makeResourceLoaderLink( $styles, |
| 169 | + ResourceLoaderModule::TYPE_STYLES |
| 170 | + ) ); |
166 | 171 | |
167 | 172 | $lb->execute( __METHOD__ ); |
168 | 173 | |