Bundle tracking with another RL module

This is slightly more efficient because it saves on early page-
load bandwidth.

Bug: T234605
Change-Id: If83420a9b4e654fd790e810fa82f922a8ba06e50
This commit is contained in:
Adam Wight 2019-10-07 10:34:31 +02:00
parent c12150082c
commit 741f5dcdaa
3 changed files with 22 additions and 32 deletions

View file

@ -78,22 +78,6 @@
"cite_references_link_many_accessibility_label"
]
},
"ext.cite.ux-enhancements": {
"scripts": [
"ext.cite.a11y.js",
"ext.cite.highlighting.js"
],
"styles": [
"ext.cite.a11y.css",
"ext.cite.highlighting.css"
],
"messages": [
"cite_reference_link_prefix",
"cite_references_link_accessibility_label",
"cite_references_link_many_accessibility_label",
"cite_references_link_accessibility_back_label"
]
},
"ext.cite.style": {
"class": "CiteCSSFileModule",
"styles": "ext.cite.style.css",

View file

@ -217,10 +217,6 @@ class Cite {
$parserOutput->addModules( 'ext.cite.ux-enhancements' );
$parserOutput->addModuleStyles( 'ext.cite.styles' );
if ( ExtensionRegistry::getInstance()->isLoaded( 'EventLogging' ) ) {
$parserOutput->addModules( 'ext.cite.tracking' );
}
$frame->setVolatile();
// new <ref> tag, we may need to bump the ref data counter

View file

@ -73,20 +73,30 @@ class CiteHooks {
public static function onResourceLoaderRegisterModules( ResourceLoader $resourceLoader ) {
$dir = dirname( __DIR__ ) . DIRECTORY_SEPARATOR;
$uxEnhancementsModule = [
'localBasePath' => $dir . 'modules',
'remoteExtPath' => 'Cite/modules',
'scripts' => [
'ext.cite.a11y.js',
'ext.cite.highlighting.js',
],
'styles' => [
'ext.cite.a11y.css',
'ext.cite.highlighting.css',
],
'messages' => [
'cite_reference_link_prefix',
'cite_references_link_accessibility_label',
'cite_references_link_many_accessibility_label',
'cite_references_link_accessibility_back_label',
],
];
if ( ExtensionRegistry::getInstance()->isLoaded( 'EventLogging' ) ) {
$resourceLoader->register( 'ext.cite.tracking', [
'localBasePath' => $dir . 'modules',
'remoteExtPath' => 'Cite/modules',
'scripts' => [
'ext.cite.tracking.js'
],
'dependencies' => 'ext.eventLogging',
'targets' => [
'desktop',
'mobile'
]
] );
// Temporary tracking for T231529
$uxEnhancementsModule['scripts'][] = 'ext.cite.tracking.js';
$uxEnhancementsModule['dependencies'][] = 'ext.eventLogging';
}
$resourceLoader->register( 'ext.cite.ux-enhancements', $uxEnhancementsModule );
if ( !ExtensionRegistry::getInstance()->isLoaded( 'VisualEditor' ) ) {
return;