mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/SyntaxHighlight_GeSHi
synced 2024-11-28 08:10:50 +00:00
Merge ext.geshi.data and ext.geshi.visualeditor modules
Until and unless there is an explicit need (and intent to support) a public interface to use this data elsewhere, there is no need for it to be a separate module. It can be its own class, but at the resource level this data should be considered a JavaScript file. And we don't create separate modules for each file. They are in the same module unless they should be semantically loaded in unrelated page contexts. The module registery is not a javascript class autoloader. There is a global cost to adding more modules to this registry. Change-Id: Ifeddef8cfe00b6c115734f92eceab251a0b75bdb
This commit is contained in:
parent
e880ae6694
commit
6ba411fe2f
|
@ -17,7 +17,7 @@
|
|||
* http://www.gnu.org/copyleft/gpl.html
|
||||
*/
|
||||
|
||||
class ResourceLoaderGeSHiDataModule extends ResourceLoaderModule {
|
||||
class ResourceLoaderGeSHiVisualEditorModule extends ResourceLoaderFileModule {
|
||||
|
||||
protected $targets = array( 'desktop', 'mobile' );
|
||||
|
||||
|
@ -26,9 +26,10 @@ class ResourceLoaderGeSHiDataModule extends ResourceLoaderModule {
|
|||
* @return string JavaScript code
|
||||
*/
|
||||
public function getScript( ResourceLoaderContext $context ) {
|
||||
return Xml::encodeJsCall(
|
||||
'mw.config.set',
|
||||
array(
|
||||
$scripts = parent::getScript( $context );
|
||||
|
||||
return $scripts . Xml::encodeJsCall(
|
||||
'mw.config.set', array(
|
||||
'wgGeSHiSupportedLanguages',
|
||||
$this->getLanguages()
|
||||
),
|
|
@ -21,7 +21,7 @@
|
|||
"AutoloadClasses": {
|
||||
"SyntaxHighlight_GeSHi": "SyntaxHighlight_GeSHi.class.php",
|
||||
"GeSHi": "SyntaxHighlight_GeSHi.compat.php",
|
||||
"ResourceLoaderGeSHiDataModule": "ResourceLoaderGeSHiDataModule.php"
|
||||
"ResourceLoaderGeSHiVisualEditorModule": "ResourceLoaderGeSHiVisualEditorModule.php"
|
||||
},
|
||||
"ExtensionFunctions": [
|
||||
"SyntaxHighlight_GeSHi::onSetup"
|
||||
|
@ -43,6 +43,7 @@
|
|||
]
|
||||
},
|
||||
"ext.geshi.visualEditor": {
|
||||
"class": "ResourceLoaderGeSHiVisualEditorModule",
|
||||
"scripts": [
|
||||
"VisualEditor/ve.dm.MWSyntaxHighlightNode.js",
|
||||
"VisualEditor/ve.ce.MWSyntaxHighlightNode.js",
|
||||
|
@ -53,8 +54,7 @@
|
|||
"VisualEditor/ve.ui.MWSyntaxHighlightInspector.css"
|
||||
],
|
||||
"dependencies": [
|
||||
"ext.visualEditor.mwcore",
|
||||
"ext.geshi.data"
|
||||
"ext.visualEditor.mwcore"
|
||||
],
|
||||
"messages": [
|
||||
"syntaxhighlight-visualeditor-mwsyntaxhighlightinspector-code",
|
||||
|
@ -62,9 +62,6 @@
|
|||
"syntaxhighlight-visualeditor-mwsyntaxhighlightinspector-title"
|
||||
],
|
||||
"targets": [ "desktop", "mobile" ]
|
||||
},
|
||||
"ext.geshi.data": {
|
||||
"class": "ResourceLoaderGeSHiDataModule"
|
||||
}
|
||||
},
|
||||
"Hooks": {
|
||||
|
|
Loading…
Reference in a new issue