diff --git a/VisualEditor.php b/VisualEditor.php index 92c3308513..be71583c13 100644 --- a/VisualEditor.php +++ b/VisualEditor.php @@ -338,39 +338,10 @@ $wgResourceModules += array( 've/dm/nodes/ve.dm.TableSectionNode.js', 've/dm/nodes/ve.dm.TextNode.js', - 've-mw/dm/nodes/ve.dm.MWEntityNode.js', - 've-mw/dm/nodes/ve.dm.MWHeadingNode.js', - 've-mw/dm/nodes/ve.dm.MWPreformattedNode.js', - 've-mw/dm/nodes/ve.dm.MWImageNode.js', - 've-mw/dm/nodes/ve.dm.MWInlineImageNode.js', - 've-mw/dm/nodes/ve.dm.MWBlockImageNode.js', - 've-mw/dm/nodes/ve.dm.MWImageCaptionNode.js', - 've-mw/dm/nodes/ve.dm.MWNumberedExternalLinkNode.js', - 've-mw/dm/nodes/ve.dm.MWTransclusionNode.js', - 've-mw/dm/nodes/ve.dm.MWReferenceListNode.js', - 've-mw/dm/nodes/ve.dm.MWReferenceNode.js', - 've-mw/dm/nodes/ve.dm.MWExtensionNode.js', - 've/dm/annotations/ve.dm.LinkAnnotation.js', - 've-mw/dm/annotations/ve.dm.MWExternalLinkAnnotation.js', - 've-mw/dm/annotations/ve.dm.MWInternalLinkAnnotation.js', 've/dm/annotations/ve.dm.TextStyleAnnotation.js', - 've-mw/dm/annotations/ve.dm.MWNowikiAnnotation.js', 've/dm/metaitems/ve.dm.AlienMetaItem.js', - 've-mw/dm/metaitems/ve.dm.MWAlienMetaItem.js', - 've-mw/dm/metaitems/ve.dm.MWCategoryMetaItem.js', - 've-mw/dm/metaitems/ve.dm.MWDefaultSortMetaItem.js', - 've-mw/dm/metaitems/ve.dm.MWLanguageMetaItem.js', - 've-mw/dm/metaitems/ve.dm.MWTransclusionMetaItem.js', - - 've-mw/dm/models/ve.dm.MWTransclusionModel.js', - 've-mw/dm/models/ve.dm.MWTransclusionPartModel.js', - 've-mw/dm/models/ve.dm.MWTransclusionContentModel.js', - 've-mw/dm/models/ve.dm.MWTemplateSpecModel.js', - 've-mw/dm/models/ve.dm.MWTemplateModel.js', - 've-mw/dm/models/ve.dm.MWTemplatePlaceholderModel.js', - 've-mw/dm/models/ve.dm.MWTemplateParameterModel.js', // ce 've/ce/ve.ce.js', @@ -414,26 +385,8 @@ $wgResourceModules += array( 've/ce/nodes/ve.ce.TableSectionNode.js', 've/ce/nodes/ve.ce.TextNode.js', - 've-mw/ce/ve.ce.MWResizableNode.js', - - 've-mw/ce/nodes/ve.ce.MWEntityNode.js', - 've-mw/ce/nodes/ve.ce.MWHeadingNode.js', - 've-mw/ce/nodes/ve.ce.MWPreformattedNode.js', - 've-mw/ce/nodes/ve.ce.MWImageNode.js', - 've-mw/ce/nodes/ve.ce.MWInlineImageNode.js', - 've-mw/ce/nodes/ve.ce.MWBlockImageNode.js', - 've-mw/ce/nodes/ve.ce.MWImageCaptionNode.js', - 've-mw/ce/nodes/ve.ce.MWNumberedExternalLinkNode.js', - 've-mw/ce/nodes/ve.ce.MWTransclusionNode.js', - 've-mw/ce/nodes/ve.ce.MWReferenceListNode.js', - 've-mw/ce/nodes/ve.ce.MWReferenceNode.js', - 've-mw/ce/nodes/ve.ce.MWExtensionNode.js', - 've/ce/annotations/ve.ce.LinkAnnotation.js', - 've-mw/ce/annotations/ve.ce.MWExternalLinkAnnotation.js', - 've-mw/ce/annotations/ve.ce.MWInternalLinkAnnotation.js', 've/ce/annotations/ve.ce.TextStyleAnnotation.js', - 've-mw/ce/annotations/ve.ce.MWNowikiAnnotation.js', // ui 've/ui/ve.ui.js', @@ -452,7 +405,6 @@ $wgResourceModules += array( 've/ui/ve.ui.TriggerRegistry.js', 've/ui/ve.ui.Action.js', 've/ui/ve.ui.ActionFactory.js', - 've-mw/ui/ve.ui.MWDialog.js', 've/ui/actions/ve.ui.AnnotationAction.js', 've/ui/actions/ve.ui.ContentAction.js', @@ -465,6 +417,139 @@ $wgResourceModules += array( 've/ui/widgets/ve.ui.SurfaceWidget.js', 've/ui/widgets/ve.ui.LinkTargetInputWidget.js', + + 've/ui/tools/ve.ui.AnnotationTool.js', + 've/ui/tools/ve.ui.ClearAnnotationTool.js', + 've/ui/tools/ve.ui.DialogTool.js', + 've/ui/tools/ve.ui.FormatTool.js', + 've/ui/tools/ve.ui.HistoryTool.js', + 've/ui/tools/ve.ui.IndentationTool.js', + 've/ui/tools/ve.ui.InspectorTool.js', + 've/ui/tools/ve.ui.ListTool.js', + + 've/ui/inspectors/ve.ui.AnnotationInspector.js', + 've/ui/inspectors/ve.ui.LinkInspector.js', + + 've/ui/widgets/ve.ui.GroupButtonWidget.js', + 've/ui/inspectors/ve.ui.SpecialCharacterInspector.js', + ), + 'styles' => array( + // ce + 've/ce/styles/ve.ce.Node.css', + 've/ce/styles/ve.ce.Surface.css', + // ui + 've/ui/styles/ve.ui.Context.css', + 've/ui/styles/ve.ui.Inspector.css', + 've/ui/styles/ve.ui.Surface.css', + 've/ui/styles/ve.ui.Tool.css', + 've/ui/styles/ve.ui.Toolbar.css', + 've/ui/styles/ve.ui.Widget.css', + ), + 'dependencies' => array( + 'rangy', + 'unicodejs.wordbreak', + 'ext.visualEditor.base', + ), + 'messages' => array( + 'visualeditor', + 'visualeditor-aliennode-tooltip', + 'visualeditor-annotationbutton-bold-tooltip', + 'visualeditor-annotationbutton-code-tooltip', + 'visualeditor-annotationbutton-italic-tooltip', + 'visualeditor-annotationbutton-link-tooltip', + 'visualeditor-annotationbutton-strikethrough-tooltip', + 'visualeditor-annotationbutton-subscript-tooltip', + 'visualeditor-annotationbutton-superscript-tooltip', + 'visualeditor-annotationbutton-underline-tooltip', + 'visualeditor-clearbutton-tooltip', + 'visualeditor-dialog-action-apply', + 'visualeditor-dialog-action-cancel', + 'visualeditor-dialog-action-goback', + 'visualeditor-formatdropdown-format-heading1', + 'visualeditor-formatdropdown-format-heading2', + 'visualeditor-formatdropdown-format-heading3', + 'visualeditor-formatdropdown-format-heading4', + 'visualeditor-formatdropdown-format-heading5', + 'visualeditor-formatdropdown-format-heading6', + 'visualeditor-formatdropdown-format-paragraph', + 'visualeditor-formatdropdown-format-preformatted', + 'visualeditor-formatdropdown-title', + 'visualeditor-help-tool', + 'visualeditor-historybutton-redo-tooltip', + 'visualeditor-historybutton-undo-tooltip', + 'visualeditor-indentationbutton-indent-tooltip', + 'visualeditor-indentationbutton-outdent-tooltip', + 'visualeditor-inspector-close-tooltip', + 'visualeditor-inspector-remove-tooltip', + 'visualeditor-languages-tool', + 'visualeditor-linkinspector-title', + 'visualeditor-listbutton-bullet-tooltip', + 'visualeditor-listbutton-number-tooltip', + 'visualeditor-specialcharacter-button-tooltip', + 'visualeditor-specialcharacterinspector-title', + 'visualeditor-specialcharinspector-characterlist-insert', + 'visualeditor-version-label', + ), + 'targets' => array( 'desktop', 'mobile' ), + ), + + 'ext.visualEditor.mwcore' => $wgVisualEditorResourceTemplate + array( + 'scripts' => array( + // dm + 've-mw/dm/nodes/ve.dm.MWEntityNode.js', + 've-mw/dm/nodes/ve.dm.MWHeadingNode.js', + 've-mw/dm/nodes/ve.dm.MWPreformattedNode.js', + 've-mw/dm/nodes/ve.dm.MWImageNode.js', + 've-mw/dm/nodes/ve.dm.MWInlineImageNode.js', + 've-mw/dm/nodes/ve.dm.MWBlockImageNode.js', + 've-mw/dm/nodes/ve.dm.MWImageCaptionNode.js', + 've-mw/dm/nodes/ve.dm.MWNumberedExternalLinkNode.js', + 've-mw/dm/nodes/ve.dm.MWTransclusionNode.js', + 've-mw/dm/nodes/ve.dm.MWReferenceListNode.js', + 've-mw/dm/nodes/ve.dm.MWReferenceNode.js', + 've-mw/dm/nodes/ve.dm.MWExtensionNode.js', + + 've-mw/dm/annotations/ve.dm.MWExternalLinkAnnotation.js', + 've-mw/dm/annotations/ve.dm.MWInternalLinkAnnotation.js', + 've-mw/dm/annotations/ve.dm.MWNowikiAnnotation.js', + + 've-mw/dm/metaitems/ve.dm.MWAlienMetaItem.js', + 've-mw/dm/metaitems/ve.dm.MWCategoryMetaItem.js', + 've-mw/dm/metaitems/ve.dm.MWDefaultSortMetaItem.js', + 've-mw/dm/metaitems/ve.dm.MWLanguageMetaItem.js', + 've-mw/dm/metaitems/ve.dm.MWTransclusionMetaItem.js', + + 've-mw/dm/models/ve.dm.MWTransclusionModel.js', + 've-mw/dm/models/ve.dm.MWTransclusionPartModel.js', + 've-mw/dm/models/ve.dm.MWTransclusionContentModel.js', + 've-mw/dm/models/ve.dm.MWTemplateSpecModel.js', + 've-mw/dm/models/ve.dm.MWTemplateModel.js', + 've-mw/dm/models/ve.dm.MWTemplatePlaceholderModel.js', + 've-mw/dm/models/ve.dm.MWTemplateParameterModel.js', + + // ce + 've-mw/ce/ve.ce.MWResizableNode.js', + + 've-mw/ce/nodes/ve.ce.MWEntityNode.js', + 've-mw/ce/nodes/ve.ce.MWHeadingNode.js', + 've-mw/ce/nodes/ve.ce.MWPreformattedNode.js', + 've-mw/ce/nodes/ve.ce.MWImageNode.js', + 've-mw/ce/nodes/ve.ce.MWInlineImageNode.js', + 've-mw/ce/nodes/ve.ce.MWBlockImageNode.js', + 've-mw/ce/nodes/ve.ce.MWImageCaptionNode.js', + 've-mw/ce/nodes/ve.ce.MWNumberedExternalLinkNode.js', + 've-mw/ce/nodes/ve.ce.MWTransclusionNode.js', + 've-mw/ce/nodes/ve.ce.MWReferenceListNode.js', + 've-mw/ce/nodes/ve.ce.MWReferenceNode.js', + 've-mw/ce/nodes/ve.ce.MWExtensionNode.js', + + 've-mw/ce/annotations/ve.ce.MWExternalLinkAnnotation.js', + 've-mw/ce/annotations/ve.ce.MWInternalLinkAnnotation.js', + 've-mw/ce/annotations/ve.ce.MWNowikiAnnotation.js', + + // ui + 've-mw/ui/ve.ui.MWDialog.js', + 've-mw/ui/widgets/ve.ui.MWLinkTargetInputWidget.js', 've-mw/ui/widgets/ve.ui.MWCategoryInputWidget.js', 've-mw/ui/widgets/ve.ui.MWCategoryPopupWidget.js', @@ -496,49 +581,25 @@ $wgResourceModules += array( 've-mw/ui/dialogs/ve.ui.MWReferenceListDialog.js', 've-mw/ui/dialogs/ve.ui.MWReferenceDialog.js', - 've/ui/tools/ve.ui.AnnotationTool.js', - 've/ui/tools/ve.ui.ClearAnnotationTool.js', - 've/ui/tools/ve.ui.DialogTool.js', - 've/ui/tools/ve.ui.FormatTool.js', - 've/ui/tools/ve.ui.HistoryTool.js', - 've/ui/tools/ve.ui.IndentationTool.js', - 've/ui/tools/ve.ui.InspectorTool.js', - 've/ui/tools/ve.ui.ListTool.js', - 've-mw/ui/tools/ve.ui.MWEditModeTool.js', 've-mw/ui/tools/ve.ui.MWFormatTool.js', 've-mw/ui/tools/ve.ui.MWDialogTool.js', 've-mw/ui/tools/ve.ui.MWPopupTool.js', 've-mw/ui/tools/ve.ui.MWInspectorTool.js', - 've/ui/inspectors/ve.ui.AnnotationInspector.js', - 've/ui/inspectors/ve.ui.LinkInspector.js', 've-mw/ui/inspectors/ve.ui.MWLinkInspector.js', 've-mw/ui/inspectors/ve.ui.MWExtensionInspector.js', - - 've/ui/widgets/ve.ui.GroupButtonWidget.js', - 've/ui/inspectors/ve.ui.SpecialCharacterInspector.js', ), 'styles' => array( // ce - 've/ce/styles/ve.ce.Node.css', 've-mw/ce/styles/ve.ce.Node.css', - 've/ce/styles/ve.ce.Surface.css', // ui - 've/ui/styles/ve.ui.Context.css', - 've/ui/styles/ve.ui.Inspector.css', - 've/ui/styles/ve.ui.Surface.css', - 've/ui/styles/ve.ui.Tool.css', - 've/ui/styles/ve.ui.Toolbar.css', - 've/ui/styles/ve.ui.Widget.css', 've-mw/ui/styles/ve.ui.MWWidget.css', 've-mw/ui/styles/ve.ui.MWInspector.css', 've-mw/ui/styles/ve.ui.MWDialog.css', ), 'dependencies' => array( - 'rangy', - 'unicodejs.wordbreak', - 'ext.visualEditor.base', + 'ext.visualEditor.core', 'mediawiki.Title', 'mediawiki.action.history.diff', 'mediawiki.user', @@ -546,25 +607,10 @@ $wgResourceModules += array( 'jquery.byteLimit', ), 'messages' => array( - // VE messages for the editor (NOT experimental mode messages) - 'visualeditor', - 'visualeditor-aliennode-tooltip', - 'visualeditor-annotationbutton-bold-tooltip', - 'visualeditor-annotationbutton-code-tooltip', - 'visualeditor-annotationbutton-italic-tooltip', - 'visualeditor-annotationbutton-link-tooltip', - 'visualeditor-annotationbutton-strikethrough-tooltip', - 'visualeditor-annotationbutton-subscript-tooltip', - 'visualeditor-annotationbutton-superscript-tooltip', - 'visualeditor-annotationbutton-underline-tooltip', 'visualeditor-beta-label', 'visualeditor-beta-warning', 'visualeditor-browserwarning', 'visualeditor-categories-tool', - 'visualeditor-clearbutton-tooltip', - 'visualeditor-dialog-action-apply', - 'visualeditor-dialog-action-cancel', - 'visualeditor-dialog-action-goback', 'visualeditor-dialog-beta-welcome-action-continue', 'visualeditor-dialog-beta-welcome-content', 'visualeditor-dialog-beta-welcome-title', @@ -625,27 +671,13 @@ $wgResourceModules += array( 'visualeditor-formatdropdown-format-mw-heading4', 'visualeditor-formatdropdown-format-mw-heading5', 'visualeditor-formatdropdown-format-mw-heading6', - 'visualeditor-formatdropdown-format-paragraph', - 'visualeditor-formatdropdown-format-preformatted', - 'visualeditor-formatdropdown-title', 'visualeditor-help-label', 'visualeditor-help-link', 'visualeditor-help-title', - 'visualeditor-help-tool', - 'visualeditor-historybutton-redo-tooltip', - 'visualeditor-historybutton-undo-tooltip', - 'visualeditor-indentationbutton-indent-tooltip', - 'visualeditor-indentationbutton-outdent-tooltip', - 'visualeditor-inspector-close-tooltip', - 'visualeditor-inspector-remove-tooltip', - 'visualeditor-languages-tool', 'visualeditor-linkinspector-illegal-title', 'visualeditor-linkinspector-suggest-external-link', 'visualeditor-linkinspector-suggest-matching-page', 'visualeditor-linkinspector-suggest-new-page', - 'visualeditor-linkinspector-title', - 'visualeditor-listbutton-bullet-tooltip', - 'visualeditor-listbutton-number-tooltip', 'visualeditor-media-input-placeholder', 'visualeditor-meta-tool', 'visualeditor-mweditmodesource-title', @@ -674,13 +706,9 @@ $wgResourceModules += array( 'visualeditor-savedialog-warning-dirty', 'visualeditor-saveerror', 'visualeditor-serializeerror', - 'visualeditor-specialcharacter-button-tooltip', - 'visualeditor-specialcharacterinspector-title', - 'visualeditor-specialcharinspector-characterlist-insert', 'visualeditor-toolbar-cancel', 'visualeditor-toolbar-insert', 'visualeditor-toolbar-savedialog', - 'visualeditor-version-label', 'visualeditor-viewpage-savewarning', 'visualeditor-wikitext-warning-title', 'visualeditor-window-title', @@ -713,8 +741,6 @@ $wgResourceModules += array( 'visualeditor-languageinspector-widget-label-language', 'visualeditor-languageinspector-widget-label-langcode', 'visualeditor-languageinspector-widget-label-direction', - 'visualeditor-languageinspector-block-tooltip', - 'visualeditor-languageinspector-block-tooltip-rtldirection', 'visualeditor-annotationbutton-language-tooltip', ), 'targets' => array( 'desktop', 'mobile' ), @@ -728,7 +754,7 @@ $wgResourceModules += array( 've-mw/ui/tools/ve.ui.MWAlienExtensionInspectorTool.js', ), 'dependencies' => array( - 'ext.visualEditor.core', + 'ext.visualEditor.mwcore', ), 'messages' => array( 'visualeditor-mwalienextensioninspector-title', @@ -744,7 +770,7 @@ $wgResourceModules += array( 've-mw/ui/tools/ve.ui.MWMathInspectorTool.js', ), 'dependencies' => array( - 'ext.visualEditor.core', + 'ext.visualEditor.mwcore', ), 'messages' => array( 'visualeditor-mwmathinspector-title', @@ -760,7 +786,7 @@ $wgResourceModules += array( 've-mw/ui/tools/ve.ui.MWHieroInspectorTool.js', ), 'dependencies' => array( - 'ext.visualEditor.core', + 'ext.visualEditor.mwcore', ), 'messages' => array( 'visualeditor-mwhieroinspector-title', @@ -780,7 +806,7 @@ $wgResourceModules += array( 'syntaxhighlight/helpers/ve.ce.MWSyntaxHighlightValidator.js', ), 'dependencies' => array( - 'ext.visualEditor.core', + 'ext.visualEditor.mwcore', ), 'messages' => array( 'visualeditor-dialog-syntaxhighlight-title', diff --git a/maintenance/makeStaticLoader.php b/maintenance/makeStaticLoader.php index 98a33ee724..bb8d9f2997 100644 --- a/maintenance/makeStaticLoader.php +++ b/maintenance/makeStaticLoader.php @@ -234,9 +234,6 @@ class MakeStaticLoader extends Maintenance { if ( isset( $registry['styles'] ) && $target !== 'test' ){ foreach ( (array)$registry['styles'] as $path ) { - if ( strpos( $path, 've-mw/' ) === 0 ) { - continue; - } $headAdd .= $indent . Html::element( 'link', array( 'rel' => 'stylesheet', 'href' => "$vePath/$path", @@ -246,18 +243,12 @@ class MakeStaticLoader extends Maintenance { if ( isset( $registry['scripts'] ) ) { foreach ( (array)$registry['scripts'] as $path ) { - if ( strpos( $path, 've-mw/' ) === 0 ) { - continue; - } $bodyAdd .= $indent . Html::element( 'script', array( 'src' => "$vePath/$path" ) ) . "\n"; } } if ( isset( $registry['debugScripts'] ) ) { foreach ( (array)$registry['debugScripts'] as $path ) { - if ( strpos( $path, 've-mw/' ) === 0 ) { - continue; - } $bodyAdd .= $indent . Html::element( 'script', array( 'src' => "$vePath/$path" ) ) . "\n"; } } diff --git a/modules/ve-mw/init/ve.init.mw.Target.js b/modules/ve-mw/init/ve.init.mw.Target.js index fd4bf2301b..7ff52e1937 100644 --- a/modules/ve-mw/init/ve.init.mw.Target.js +++ b/modules/ve-mw/init/ve.init.mw.Target.js @@ -49,7 +49,7 @@ ve.init.mw.Target = function VeInitMwTarget( $container, pageName, revisionId ) this.surface = null; this.modules = [ - 'ext.visualEditor.core', + 'ext.visualEditor.mwcore', 'ext.visualEditor.data' ] .concat(