Florianschmidtwelzow has uploaded a new change for review.
https://gerrit.wikimedia.org/r/187947
Change subject: Hygiene: Move wgResourceLoaderLESSVars out of extension function
......................................................................
Hygiene: Move wgResourceLoaderLESSVars out of extension function
Change-Id: If1a25593ff38270a1a3d356e996f6325d34504f8
---
M MobileFrontend.php
M includes/MobileFrontend.hooks.php
2 files changed, 16 insertions(+), 13 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend
refs/changes/47/187947/1
diff --git a/MobileFrontend.php b/MobileFrontend.php
index 1caabaf..5eec60a 100644
--- a/MobileFrontend.php
+++ b/MobileFrontend.php
@@ -186,22 +186,12 @@
function efMobileFrontend_Setup() {
global $wgMFNearby, $wgSpecialPages, $wgSpecialPageGroups,
$wgResourceLoaderLESSVars,
$wgResourceLoaderLESSImportPaths,
- $wgMFDeviceWidthTablet, $wgMFDeviceWidthMobileSmall,
$wgResourceModules, $wgMobileVEModules;
+ $wgResourceModules, $wgMobileVEModules;
if ( $wgMFNearby ) {
$wgSpecialPages['Nearby'] = 'SpecialNearby';
$wgSpecialPageGroups['Nearby'] = 'pages';
}
-
- $wgResourceLoaderLESSVars = array_merge( $wgResourceLoaderLESSVars,
- array(
- 'wgMFDeviceWidthTablet' => "{$wgMFDeviceWidthTablet}px",
- 'wgMFDeviceWidthMobileSmall' =>
"{$wgMFDeviceWidthMobileSmall}px",
- 'wgMFThumbnailTiny' => MobilePage::TINY_IMAGE_WIDTH .
'px',
- 'wgMFThumbnailSmall' => MobilePage::SMALL_IMAGE_WIDTH
. 'px',
- 'wgMFThumbnailMedium' => MobilePage::MEDIUM_IMAGE_WIDTH
. 'px',
- )
- );
}
// Config instance
diff --git a/includes/MobileFrontend.hooks.php
b/includes/MobileFrontend.hooks.php
index 8e27c55..ed6ca55 100644
--- a/includes/MobileFrontend.hooks.php
+++ b/includes/MobileFrontend.hooks.php
@@ -816,12 +816,25 @@
* @return bool Always true
*/
public static function onResourceLoaderRegisterModules( ResourceLoader
&$resourceLoader ) {
+ global $wgResourceLoaderLESSVars;
+
+ $config = MobileContext::singleton()->getMFConfig();
+
+ // add LESS vars
+ $wgResourceLoaderLESSVars = array_merge(
$wgResourceLoaderLESSVars,
+ array(
+ 'wgMFDeviceWidthTablet' => "{$config->get(
'MFDeviceWidthTablet' )}px",
+ 'wgMFDeviceWidthMobileSmall' => "{$config->get(
'MFDeviceWidthMobileSmall' )}px",
+ 'wgMFThumbnailTiny' =>
MobilePage::TINY_IMAGE_WIDTH . 'px',
+ 'wgMFThumbnailSmall' =>
MobilePage::SMALL_IMAGE_WIDTH . 'px',
+ 'wgMFThumbnailMedium' =>
MobilePage::MEDIUM_IMAGE_WIDTH . 'px',
+ )
+ );
self::registerMobileLoggingSchemasModule();
// add VisualEditor related modules only, if VisualEditor seems
to be installed - T85007
if ( class_exists( 'VisualEditorHooks' ) ) {
- $mobileVisualEditorRLmodule =
- MobileContext::singleton()->getMFConfig()->get(
'MobileVEModules' );
+ $mobileVisualEditorRLmodule = $config->get(
'MobileVEModules' );
$resourceLoader->register( $mobileVisualEditorRLmodule
);
}
--
To view, visit https://gerrit.wikimedia.org/r/187947
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: If1a25593ff38270a1a3d356e996f6325d34504f8
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Florianschmidtwelzow <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits