}
$sk = $this->getSkin();
- // add skin specific modules
- $modules = $sk->getDefaultModules();
-
- // Enforce various default modules for all pages and all skins
- $coreModules = [
- // Keep this list as small as possible
- 'site',
- 'mediawiki.page.startup',
- 'mediawiki.user',
- ];
-
- // Support for high-density display images if enabled
- if ( $config->get( 'ResponsiveImages' ) ) {
- $coreModules[] = 'mediawiki.hidpi';
- }
-
- $this->addModules( $coreModules );
- foreach ( $modules as $group ) {
+ foreach ( $sk->getDefaultModules() as $group ) {
$this->addModules( $group );
}
+
MWDebug::addModules( $this );
// Avoid PHP 7.1 warning of passing $this by reference
global $wgUseAjax, $wgEnableAPI, $wgEnableWriteAPI;
$out = $this->getOutput();
+ $config = $this->getConfig();
$user = $out->getUser();
$modules = [
+ // modules not specific to any specific skin or page
+ 'core' => [
+ // Enforce various default modules for all pages and all skins
+ // Keep this list as small as possible
+ 'site',
+ 'mediawiki.page.startup',
+ 'mediawiki.user',
+ ],
// modules that enhance the page content in some way
'content' => [
'mediawiki.page.ready',
'user' => [],
];
+ // Support for high-density display images if enabled
+ if ( $config->get( 'ResponsiveImages' ) ) {
+ $modules['core'][] = 'mediawiki.hidpi';
+ }
+
// Preload jquery.tablesorter for mediawiki.page.ready
if ( strpos( $out->getHTML(), 'sortable' ) !== false ) {
$modules['content'][] = 'jquery.tablesorter';