Blank MediaWiki page:
head>
load.php:startup
load([ top ])
body>
load.php:skins.vector&only=scripts
load([ bottom ])
Skin styles are loaded outside ResourceLoader from the <head>
(so they don't wait for startup, and don't rely on javascript).
Fair enough for basic page styling.
Then the real `mw.loader`-able part of the module should be
separated. There is no reason for it to also be loaded outside
`mw.loader`.
Change-Id: Ife69c5a443aac9eec8c2ec06d986b53b2379816f
- /* Special modules who have their own classes */
+ /**
+ * Special modules who have their own classes
+ */
// Scripts managed by the local wiki (stored in the MediaWiki namespace)
'site' => array( 'class' => 'ResourceLoaderSiteModule' ),
// Scripts managed by the local wiki (stored in the MediaWiki namespace)
'site' => array( 'class' => 'ResourceLoaderSiteModule' ),
// Scripts for the dynamic language specific data, like grammar forms.
'mediawiki.language.data' => array( 'class' => 'ResourceLoaderLanguageDataModule' ),
// Scripts for the dynamic language specific data, like grammar forms.
'mediawiki.language.data' => array( 'class' => 'ResourceLoaderLanguageDataModule' ),
+ /**
+ * Skins
+ * Be careful not to add 'scripts' to these modules,
+ * since they are loaded with OutputPage::addModuleStyles so that the skin styles
+ * apply without javascript.
+ * If a skin needs custom js in the interface, register a separate module
+ * and add it to the load queue with OutputPage::addModules.
+ *
+ * See Vector for an example.
+ */
'skins.chick' => array(
'styles' => array( 'chick/main.css' => array( 'media' => 'screen, handheld' ) ),
'skins.chick' => array(
'styles' => array( 'chick/main.css' => array( 'media' => 'screen, handheld' ) ),
'vector/screen.css' => array( 'media' => 'screen' ),
'vector/screen-hd.css' => array( 'media' => 'screen and (min-width: 982px)' ),
),
'vector/screen.css' => array( 'media' => 'screen' ),
'vector/screen-hd.css' => array( 'media' => 'screen and (min-width: 982px)' ),
),
+ 'remoteBasePath' => $GLOBALS['wgStylePath'],
+ 'localBasePath' => $GLOBALS['wgStyleDirectory'],
+ ),
+ 'skins.vector.js' => array(
'scripts' => 'vector/vector.js',
'remoteBasePath' => $GLOBALS['wgStylePath'],
'localBasePath' => $GLOBALS['wgStyleDirectory'],
'scripts' => 'vector/vector.js',
'remoteBasePath' => $GLOBALS['wgStylePath'],
'localBasePath' => $GLOBALS['wgStyleDirectory'],
"/{$this->stylename}/csshover{$min}.htc\")}</style><![endif]-->"
);
"/{$this->stylename}/csshover{$min}.htc\")}</style><![endif]-->"
);
- $out->addModuleScripts( 'skins.vector' );
+ $out->addModules( 'skins.vector.js' );