From 6928b7ec8d53fee83449615a2a9a9d0fb5e06c9a Mon Sep 17 00:00:00 2001 From: Timo Tijhof Date: Sat, 13 Apr 2019 18:29:12 +0100 Subject: [PATCH] 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 --- extension.json | 5 ++++- includes/UniversalLanguageSelectorHooks.php | 23 +++------------------ 2 files changed, 7 insertions(+), 21 deletions(-) diff --git a/extension.json b/extension.json index 6192c8de..1dd4888a 100644 --- a/extension.json +++ b/extension.json @@ -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", diff --git a/includes/UniversalLanguageSelectorHooks.php b/includes/UniversalLanguageSelectorHooks.php index e19dd598..ded9f6ed 100644 --- a/includes/UniversalLanguageSelectorHooks.php +++ b/includes/UniversalLanguageSelectorHooks.php @@ -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 ); } }