mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/SyntaxHighlight_GeSHi
synced 2024-11-24 06:24:29 +00:00
Register VE module unconditionally
Change-Id: Ifccc0223c2b57c0de6f6c14355850213b090f8fb
This commit is contained in:
parent
583e3b3db8
commit
16af4f3c6b
|
@ -53,6 +53,40 @@
|
|||
"scripts": [
|
||||
"pygments.linenumbers.js"
|
||||
]
|
||||
},
|
||||
"ext.geshi.visualEditor": {
|
||||
"class": "ResourceLoaderSyntaxHighlightVisualEditorModule",
|
||||
"scripts": [
|
||||
"ve-syntaxhighlight/ve.dm.MWSyntaxHighlightNode.js",
|
||||
"ve-syntaxhighlight/ve.dm.MWBlockSyntaxHighlightNode.js",
|
||||
"ve-syntaxhighlight/ve.dm.MWInlineSyntaxHighlightNode.js",
|
||||
"ve-syntaxhighlight/ve.ce.MWSyntaxHighlightNode.js",
|
||||
"ve-syntaxhighlight/ve.ce.MWBlockSyntaxHighlightNode.js",
|
||||
"ve-syntaxhighlight/ve.ce.MWInlineSyntaxHighlightNode.js",
|
||||
"ve-syntaxhighlight/ve.ui.MWSyntaxHighlightWindow.js",
|
||||
"ve-syntaxhighlight/ve.ui.MWSyntaxHighlightDialog.js",
|
||||
"ve-syntaxhighlight/ve.ui.MWSyntaxHighlightDialogTool.js",
|
||||
"ve-syntaxhighlight/ve.ui.MWSyntaxHighlightInspector.js",
|
||||
"ve-syntaxhighlight/ve.ui.MWSyntaxHighlightInspectorTool.js"
|
||||
],
|
||||
"styles": [
|
||||
"ve-syntaxhighlight/ve.ce.MWSyntaxHighlightNode.css",
|
||||
"ve-syntaxhighlight/ve.ui.MWSyntaxHighlightDialog.css",
|
||||
"ve-syntaxhighlight/ve.ui.MWSyntaxHighlightInspector.css"
|
||||
],
|
||||
"dependencies": [
|
||||
"ext.visualEditor.mwcore",
|
||||
"oojs-ui.styles.icons-editing-advanced"
|
||||
],
|
||||
"messages": [
|
||||
"syntaxhighlight-visualeditor-mwsyntaxhighlightinspector-code",
|
||||
"syntaxhighlight-visualeditor-mwsyntaxhighlightinspector-language",
|
||||
"syntaxhighlight-visualeditor-mwsyntaxhighlightinspector-none",
|
||||
"syntaxhighlight-visualeditor-mwsyntaxhighlightinspector-showlines",
|
||||
"syntaxhighlight-visualeditor-mwsyntaxhighlightinspector-startingline",
|
||||
"syntaxhighlight-visualeditor-mwsyntaxhighlightinspector-title"
|
||||
],
|
||||
"targets": [ "desktop", "mobile" ]
|
||||
}
|
||||
},
|
||||
"Hooks": {
|
||||
|
@ -64,9 +98,6 @@
|
|||
],
|
||||
"ApiFormatHighlight": [
|
||||
"SyntaxHighlight::onApiFormatHighlight"
|
||||
],
|
||||
"ResourceLoaderRegisterModules": [
|
||||
"SyntaxHighlight::onResourceLoaderRegisterModules"
|
||||
]
|
||||
},
|
||||
"attributes": {
|
||||
|
|
|
@ -592,53 +592,4 @@ class SyntaxHighlight {
|
|||
// Inform MediaWiki that we have parsed this page and it shouldn't mess with it.
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Conditionally register resource loader modules that depends on the
|
||||
* VisualEditor MediaWiki extension.
|
||||
*
|
||||
* @param ResourceLoader $resourceLoader
|
||||
*/
|
||||
public static function onResourceLoaderRegisterModules( $resourceLoader ) {
|
||||
if ( !ExtensionRegistry::getInstance()->isLoaded( 'VisualEditor' ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$resourceLoader->register( 'ext.geshi.visualEditor', [
|
||||
'class' => ResourceLoaderSyntaxHighlightVisualEditorModule::class,
|
||||
'localBasePath' => __DIR__ . '/../modules',
|
||||
'remoteExtPath' => 'SyntaxHighlight_GeSHi/modules',
|
||||
'scripts' => [
|
||||
've-syntaxhighlight/ve.dm.MWSyntaxHighlightNode.js',
|
||||
've-syntaxhighlight/ve.dm.MWBlockSyntaxHighlightNode.js',
|
||||
've-syntaxhighlight/ve.dm.MWInlineSyntaxHighlightNode.js',
|
||||
've-syntaxhighlight/ve.ce.MWSyntaxHighlightNode.js',
|
||||
've-syntaxhighlight/ve.ce.MWBlockSyntaxHighlightNode.js',
|
||||
've-syntaxhighlight/ve.ce.MWInlineSyntaxHighlightNode.js',
|
||||
've-syntaxhighlight/ve.ui.MWSyntaxHighlightWindow.js',
|
||||
've-syntaxhighlight/ve.ui.MWSyntaxHighlightDialog.js',
|
||||
've-syntaxhighlight/ve.ui.MWSyntaxHighlightDialogTool.js',
|
||||
've-syntaxhighlight/ve.ui.MWSyntaxHighlightInspector.js',
|
||||
've-syntaxhighlight/ve.ui.MWSyntaxHighlightInspectorTool.js',
|
||||
],
|
||||
'styles' => [
|
||||
've-syntaxhighlight/ve.ce.MWSyntaxHighlightNode.css',
|
||||
've-syntaxhighlight/ve.ui.MWSyntaxHighlightDialog.css',
|
||||
've-syntaxhighlight/ve.ui.MWSyntaxHighlightInspector.css',
|
||||
],
|
||||
'dependencies' => [
|
||||
'ext.visualEditor.mwcore',
|
||||
'oojs-ui.styles.icons-editing-advanced'
|
||||
],
|
||||
'messages' => [
|
||||
'syntaxhighlight-visualeditor-mwsyntaxhighlightinspector-code',
|
||||
'syntaxhighlight-visualeditor-mwsyntaxhighlightinspector-language',
|
||||
'syntaxhighlight-visualeditor-mwsyntaxhighlightinspector-none',
|
||||
'syntaxhighlight-visualeditor-mwsyntaxhighlightinspector-showlines',
|
||||
'syntaxhighlight-visualeditor-mwsyntaxhighlightinspector-startingline',
|
||||
'syntaxhighlight-visualeditor-mwsyntaxhighlightinspector-title',
|
||||
],
|
||||
'targets' => [ 'desktop', 'mobile' ],
|
||||
] );
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue