Merge ext.uls.eventlogger into ext.uls.common
This could've been done longer ago (by defining ext.uls.common in Hooks.php), but didn't notice it before. The ext.uls.eventlogger was (if configured) loaded on all page loads. Same as ext.uls.init (but without config condition). ext.uls.ext is an empty shim around ext.uls.common, which is thus also loaded on all pages. Merge this into there given has no reason for being its own module. They are always loaded together. Change-Id: Icdda6f27470a1d56a37275164c06541514a488a0
This commit is contained in:
@@ -110,7 +110,10 @@
|
||||
"ResourceModules": {
|
||||
"ext.uls.common": {
|
||||
"targets": [ "desktop", "mobile" ],
|
||||
"scripts": "js/ext.uls.common.js",
|
||||
"scripts": [
|
||||
"js/ext.uls.eventlogger.js",
|
||||
"js/ext.uls.common.js"
|
||||
],
|
||||
"styles": "css/ext.uls.less",
|
||||
"skinStyles": {
|
||||
"monobook": "css/ext.uls-monobook.css",
|
||||
|
||||
@@ -107,13 +107,7 @@ class UniversalLanguageSelectorHooks {
|
||||
* Hook: BeforePageDisplay
|
||||
*/
|
||||
public static function addModules( $out, $skin ) {
|
||||
global $wgULSPosition, $wgULSGeoService, $wgULSEventLogging;
|
||||
|
||||
// If EventLogging integration is enabled, load the schema module
|
||||
// and the event logging functions module
|
||||
if ( $wgULSEventLogging ) {
|
||||
$out->addModules( 'ext.uls.eventlogger' );
|
||||
}
|
||||
global $wgULSPosition, $wgULSGeoService;
|
||||
|
||||
// Soft dependency to Wikibase client. Don't enable CLL if links are managed manually.
|
||||
$excludedLinks = $out->getProperty( 'noexternallanglinks' );
|
||||
@@ -468,12 +462,12 @@ class UniversalLanguageSelectorHooks {
|
||||
}
|
||||
|
||||
/**
|
||||
* Conditionally register module ext.uls.eventlogger.
|
||||
* Conditionally register modules.
|
||||
*
|
||||
* @param ResourceLoader $resourceLoader
|
||||
*/
|
||||
public static function onResourceLoaderRegisterModules( ResourceLoader $resourceLoader ) {
|
||||
global $wgULSEventLogging, $wgVersion;
|
||||
global $wgVersion;
|
||||
|
||||
$modules = [];
|
||||
$modules['ext.uls.displaysettings'] = [
|
||||
@@ -506,17 +500,6 @@ class UniversalLanguageSelectorHooks {
|
||||
$modules['ext.uls.preferences']['dependencies'][] = 'mediawiki.api.options';
|
||||
}
|
||||
|
||||
if ( $wgULSEventLogging ) {
|
||||
$modules['ext.uls.eventlogger'] = [
|
||||
'scripts' => 'js/ext.uls.eventlogger.js',
|
||||
'dependencies' => [
|
||||
'mediawiki.user',
|
||||
],
|
||||
'localBasePath' => __DIR__ . '/../resources',
|
||||
'remoteExtPath' => 'UniversalLanguageSelector/resources',
|
||||
];
|
||||
}
|
||||
|
||||
$resourceLoader->register( $modules );
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user