jenkins-bot has submitted this change and it was merged.

Change subject: Don't add VisualEditor related modules if VE isn't installed
......................................................................


Don't add VisualEditor related modules if VE isn't installed

Bug: T85007
Change-Id: I9943957b50c0d9bfb93c346078b75bc6a0237248
---
M MobileFrontend.php
M includes/Resources.php
2 files changed, 37 insertions(+), 27 deletions(-)

Approvals:
  Jdlrobson: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/MobileFrontend.php b/MobileFrontend.php
index 2d97529..7b751e4 100644
--- a/MobileFrontend.php
+++ b/MobileFrontend.php
@@ -177,7 +177,7 @@
 function efMobileFrontend_Setup() {
        global $wgMFNearby, $wgSpecialPages, $wgSpecialPageGroups, 
$wgResourceLoaderLESSVars,
                $wgResourceLoaderLESSImportPaths,
-               $wgMFDeviceWidthTablet, $wgMFDeviceWidthMobileSmall;
+               $wgMFDeviceWidthTablet, $wgMFDeviceWidthMobileSmall, 
$wgResourceModules, $wgMobileVEModules;
 
        // Depends on Mantle extension
        if ( !class_exists( 'MantleHooks' ) ) {
@@ -203,6 +203,11 @@
                        'wgMFThumbnailMedium' => MobilePage::MEDIUM_IMAGE_WIDTH 
. 'px',
                )
        );
+
+       // add VisualEditor related modules only, if VisualEditor seems to be 
installed - T85007
+       if ( class_exists( 'VisualEditorHooks' ) ) {
+               $wgResourceModules = array_merge( $wgResourceModules, 
$wgMobileVEModules );
+       }
 }
 
 // ResourceLoader modules
diff --git a/includes/Resources.php b/includes/Resources.php
index c0cbcb9..05e0cf6 100644
--- a/includes/Resources.php
+++ b/includes/Resources.php
@@ -347,32 +347,6 @@
                ),
        ),
 
-       'mobile.editor.ve' => $wgMFResourceBoilerplate + array(
-               'dependencies' => array(
-                       'ext.visualEditor.mobileViewTarget',
-                       'mobile.stable',
-                       'mobile.templates',
-                       'mobile.editor.common',
-                       'mobile.overlays',
-               ),
-               'styles' => array(
-                       'less/modules/editor/VisualEditorOverlay.less',
-               ),
-               'scripts' => array(
-                       'javascripts/modules/editor/VisualEditorOverlay.js',
-               ),
-               'templates' => array(
-                       'contentVE.hogan' => 
'templates/modules/editor/contentVE.hogan',
-               ),
-               'messages' => array(
-                       'mobile-frontend-page-edit-summary',
-                       'mobile-frontend-editor-editing',
-               ),
-               'targets' => array(
-                       'mobile',
-               ),
-       ),
-
        'mobile.editor.overlay' => $wgMFResourceFileModuleBoilerplate + array(
                'dependencies' => array(
                        'mobile.editor.common',
@@ -1105,6 +1079,37 @@
 ) );
 
 /**
+ * Mobile VisualEditor related modules
+ */
+$wgMobileVEModules = array(
+       'mobile.editor.ve' => $wgMFResourceBoilerplate + array(
+               'dependencies' => array(
+                       'ext.visualEditor.mobileViewTarget',
+                       'mobile.stable',
+                       'mobile.templates',
+                       'mobile.editor.common',
+                       'mobile.overlays',
+               ),
+               'styles' => array(
+                       'less/modules/editor/VisualEditorOverlay.less',
+               ),
+               'scripts' => array(
+                       'javascripts/modules/editor/VisualEditorOverlay.js',
+               ),
+               'templates' => array(
+                       'contentVE.hogan' => 
'templates/modules/editor/contentVE.hogan',
+               ),
+               'messages' => array(
+                       'mobile-frontend-page-edit-summary',
+                       'mobile-frontend-editor-editing',
+               ),
+               'targets' => array(
+                       'mobile',
+               ),
+       ),
+);
+
+/**
  * Special page modules
  * @todo FIXME: Remove the need for these by making more reusable CSS
  *

-- 
To view, visit https://gerrit.wikimedia.org/r/181403
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I9943957b50c0d9bfb93c346078b75bc6a0237248
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Florianschmidtwelzow <[email protected]>
Gerrit-Reviewer: Alex Monk <[email protected]>
Gerrit-Reviewer: Bmansurov <[email protected]>
Gerrit-Reviewer: Esanders <[email protected]>
Gerrit-Reviewer: Florianschmidtwelzow <[email protected]>
Gerrit-Reviewer: Jdlrobson <[email protected]>
Gerrit-Reviewer: Krinkle <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to