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:
Timo Tijhof
2019-04-13 18:29:12 +01:00
committed by Santhosh
parent 49ed2a5ac4
commit 6928b7ec8d
2 changed files with 7 additions and 21 deletions

View File

@@ -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 );
}
}