feat: avoid loading unnessecary features

This commit is contained in:
alistair3149 2021-06-09 13:48:38 -04:00
parent 82d48ac4e8
commit 5fcba674ba
2 changed files with 59 additions and 7 deletions

View file

@ -228,6 +228,22 @@ class SkinCitizen extends SkinMustache {
return $urls;
}
/**
* Returns the javascript entry modules to load. Only modules that need to
* be overriden or added conditionally should be placed here.
* @return array
*/
public function getDefaultModules() {
$modules = parent::getDefaultModules();
$modules['content'] = array_diff( $modules['content'], [
// Citizen provides its own implementation. Loading this will break display.
'mediawiki.toc'
] );
return $modules;
}
/**
* Set up optional skin features
*
@ -264,6 +280,7 @@ class SkinCitizen extends SkinMustache {
$out->addBodyClasses( 'skin-citizen-has-toc' );
// Disabled style condition loading due to pop in
$options['scripts'][] = 'skins.citizen.scripts.toc';
$options['styles'][] = 'skins.citizen.styles.toc';
}
// Drawer sitestats

View file

@ -27,7 +27,6 @@
"styles": [
"skins.citizen.styles",
"skins.citizen.styles.fonts",
"skins.citizen.styles.toc",
"skins.citizen.icons",
"skins.citizen.icons.ca",
"skins.citizen.icons.es",
@ -93,7 +92,13 @@
"desktop",
"mobile"
],
"features": [],
"features": {
"content-parser-output": false,
"content-body": false,
"logo": false,
"legacy": false,
"toc": false
},
"styles": [ "resources/skins.citizen.styles/skin.less" ]
},
"skins.citizen.styles.debug": {
@ -102,7 +107,13 @@
"desktop",
"mobile"
],
"features": [],
"features": {
"content-parser-output": false,
"content-body": false,
"logo": false,
"legacy": false,
"toc": false
},
"styles": [ "resources/skins.citizen.styles.debug/skins.citizen.styles.debug.less" ]
},
"skins.citizen.styles.fonts": {
@ -111,7 +122,13 @@
"desktop",
"mobile"
],
"features": [],
"features": {
"content-parser-output": false,
"content-body": false,
"logo": false,
"legacy": false,
"toc": false
},
"styles": [ "resources/skins.citizen.styles.fonts/skins.citizen.styles.fonts.less" ]
},
"skins.citizen.styles.sections": {
@ -120,7 +137,13 @@
"desktop",
"mobile"
],
"features": [],
"features": {
"content-parser-output": false,
"content-body": false,
"logo": false,
"legacy": false,
"toc": false
},
"styles": [ "resources/skins.citizen.styles.sections/skins.citizen.styles.sections.less" ]
},
"skins.citizen.styles.sitestats": {
@ -129,7 +152,13 @@
"desktop",
"mobile"
],
"features": [],
"features": {
"content-parser-output": false,
"content-body": false,
"logo": false,
"legacy": false,
"toc": false
},
"styles": [ "resources/skins.citizen.styles.sitestats/skins.citizen.styles.sitestats.less" ]
},
"skins.citizen.styles.toc": {
@ -138,7 +167,13 @@
"desktop",
"mobile"
],
"features": [],
"features": {
"content-parser-output": false,
"content-body": false,
"logo": false,
"legacy": false,
"toc": false
},
"styles": [ "resources/skins.citizen.styles.toc/skins.citizen.styles.toc.less" ]
},
"skins.citizen.scripts": {