mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Cite
synced 2024-11-24 06:54:00 +00:00
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:
parent
c12150082c
commit
741f5dcdaa
|
@ -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",
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue