From da5eacbe2e096359dafe1aacf82b01dc95222890 Mon Sep 17 00:00:00 2001 From: Roan Kattouw Date: Tue, 1 Jul 2014 16:50:57 -0700 Subject: [PATCH] Split mwtransclusion and mwreference into core and non-core modules Mobile doesn't want the tool+dialog functionality for those yet, so move them to a separate module and only load the bare bones for mobile. We did the same with mwimage/mwimage.core. Change-Id: I9185ce62f458b3de08cbd28f2a41370d2301de9d --- VisualEditor.php | 48 +++++++++++++------ .../init/targets/ve.init.mw.ViewPageTarget.js | 1 + modules/ve-mw/init/ve.init.mw.Target.js | 3 +- 3 files changed, 37 insertions(+), 15 deletions(-) diff --git a/VisualEditor.php b/VisualEditor.php index 15af055c27..501dd6c1d3 100644 --- a/VisualEditor.php +++ b/VisualEditor.php @@ -1030,7 +1030,7 @@ $wgResourceModules += array( 'targets' => array( 'desktop', 'mobile' ), ), - 'ext.visualEditor.mwreference' => $wgVisualEditorResourceTemplate + array( + 'ext.visualEditor.mwreference.core' => $wgVisualEditorResourceTemplate + array( 'scripts' => array( 'modules/ve-mw/dm/models/ve.dm.MWReferenceModel.js', @@ -1039,7 +1039,24 @@ $wgResourceModules += array( 'modules/ve-mw/ce/nodes/ve.ce.MWReferenceListNode.js', 'modules/ve-mw/ce/nodes/ve.ce.MWReferenceNode.js', + ), + 'styles' => array( + 'modules/ve-mw/ce/styles/nodes/ve.ce.MWReferenceListNode.css', + 'modules/ve-mw/ce/styles/nodes/ve.ce.MWReferenceNode.css', + ), + 'dependencies' => array( + 'ext.visualEditor.mwcore', + ), + 'messages' => array( + 'visualeditor-referencelist-isempty', + 'visualeditor-referencelist-isempty-default', + 'visualeditor-referencelist-missingref', + ), + 'targets' => array( 'desktop', 'mobile' ) + ), + 'ext.visualEditor.mwreference' => $wgVisualEditorResourceTemplate + array( + 'scripts' => array( 'modules/ve-mw/ui/widgets/ve.ui.MWReferenceSearchWidget.js', 'modules/ve-mw/ui/widgets/ve.ui.MWReferenceResultWidget.js', @@ -1051,13 +1068,11 @@ $wgResourceModules += array( 'modules/ve-mw/ui/tools/ve.ui.MWCitationDialogTool.js', ), 'styles' => array( - 'modules/ve-mw/ce/styles/nodes/ve.ce.MWReferenceListNode.css', - 'modules/ve-mw/ce/styles/nodes/ve.ce.MWReferenceNode.css', 'modules/ve-mw/ui/styles/widgets/ve.ui.MWReferenceResultWidget.css', 'modules/ve-mw/ui/styles/widgets/ve.ui.MWReferenceSearchWidget.css', ), 'dependencies' => array( - 'ext.visualEditor.mwcore', + 'ext.visualEditor.mwreference.core', 'ext.visualEditor.mwtransclusion', ), 'messages' => array( @@ -1075,19 +1090,26 @@ $wgResourceModules += array( 'visualeditor-dialogbutton-reference-tooltip', 'visualeditor-dialogbutton-referencelist-tooltip', 'visualeditor-reference-input-placeholder', - 'visualeditor-referencelist-isempty', - 'visualeditor-referencelist-isempty-default', - 'visualeditor-referencelist-missingref', + ), + 'targets' => array( 'desktop', 'mobile' ), + ), + + 'ext.visualEditor.mwtransclusion.core' => $wgVisualEditorResourceTemplate + array( + 'scripts' => array( + 'modules/ve-mw/dm/nodes/ve.dm.MWTransclusionNode.js', + + 'modules/ve-mw/dm/metaitems/ve.dm.MWTransclusionMetaItem.js', + + 'modules/ve-mw/ce/nodes/ve.ce.MWTransclusionNode.js', + ), + 'dependencies' => array( + 'ext.visualEditor.mwcore', ), 'targets' => array( 'desktop', 'mobile' ), ), 'ext.visualEditor.mwtransclusion' => $wgVisualEditorResourceTemplate + array( 'scripts' => array( - 'modules/ve-mw/dm/nodes/ve.dm.MWTransclusionNode.js', - - 'modules/ve-mw/dm/metaitems/ve.dm.MWTransclusionMetaItem.js', - 'modules/ve-mw/dm/models/ve.dm.MWTransclusionModel.js', 'modules/ve-mw/dm/models/ve.dm.MWTransclusionPartModel.js', 'modules/ve-mw/dm/models/ve.dm.MWTransclusionContentModel.js', @@ -1096,8 +1118,6 @@ $wgResourceModules += array( 'modules/ve-mw/dm/models/ve.dm.MWTemplatePlaceholderModel.js', 'modules/ve-mw/dm/models/ve.dm.MWParameterModel.js', - 'modules/ve-mw/ce/nodes/ve.ce.MWTransclusionNode.js', - 'modules/ve-mw/ui/widgets/ve.ui.MWParameterSearchWidget.js', 'modules/ve-mw/ui/widgets/ve.ui.MWParameterResultWidget.js', 'modules/ve-mw/ui/widgets/ve.ui.MWMoreParametersResultWidget.js', @@ -1133,7 +1153,7 @@ $wgResourceModules += array( ), ), 'dependencies' => array( - 'ext.visualEditor.mwcore', + 'ext.visualEditor.mwtransclusion.core', 'mediawiki.jqueryMsg', ), 'messages' => array( diff --git a/modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.js b/modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.js index c07cd9ff3b..9587cba420 100644 --- a/modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.js +++ b/modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.js @@ -71,6 +71,7 @@ ve.init.mw.ViewPageTarget = function VeInitMwViewPageTarget() { 'ext.visualEditor.mwgallery', 'ext.visualEditor.mwimage', 'ext.visualEditor.mwmeta', + 'ext.visualEditor.mwreference', 'ext.visualEditor.mwtransclusion' ); diff --git a/modules/ve-mw/init/ve.init.mw.Target.js b/modules/ve-mw/init/ve.init.mw.Target.js index 0bbb815b86..8d1086f311 100644 --- a/modules/ve-mw/init/ve.init.mw.Target.js +++ b/modules/ve-mw/init/ve.init.mw.Target.js @@ -44,7 +44,8 @@ ve.init.mw.Target = function VeInitMwTarget( $container, pageName, revisionId ) 'ext.visualEditor.mwcore', 'ext.visualEditor.mwlink', 'ext.visualEditor.data', - 'ext.visualEditor.mwreference' + 'ext.visualEditor.mwreference.core', + 'ext.visualEditor.mwtransclusion.core' ] .concat( this.constructor.static.iconModuleStyles ) .concat( conf.pluginModules || [] );