MediaWiki  1.34.0
ResourceLoaderSyntaxHighlightVisualEditorModule.php
Go to the documentation of this file.
1 <?php
20 
21  protected $targets = [ 'desktop', 'mobile' ];
22 
28  $scripts = parent::getScript( $context );
29 
30  return $scripts . Xml::encodeJsCall(
31  've.dm.MWSyntaxHighlightNode.static.addPygmentsLanguages', [
32  $this->getPygmentsLanguages()
33  ],
34  ResourceLoader::inDebugMode()
36  've.dm.MWSyntaxHighlightNode.static.addGeshiToPygmentsMap', [
38  ],
39  ResourceLoader::inDebugMode()
41  've.dm.MWSyntaxHighlightNode.static.addPygmentsToAceMap', [
43  ],
44  ResourceLoader::inDebugMode()
45  );
46  }
47 
52  private function getPygmentsLanguages() {
53  return array_keys( require __DIR__ . '/../SyntaxHighlight.lexers.php' );
54  }
55 
59  public function enableModuleContentVersion() {
60  return true;
61  }
62 
66  public function supportsURLLoading() {
67  return false;
68  }
69 }
ResourceLoaderContext
Context object that contains information about the state of a specific ResourceLoader web request.
Definition: ResourceLoaderContext.php:33
ResourceLoaderSyntaxHighlightVisualEditorModule
This program is free software; you can redistribute it and/or modify it under the terms of the GNU Ge...
Definition: ResourceLoaderSyntaxHighlightVisualEditorModule.php:19
ResourceLoaderSyntaxHighlightVisualEditorModule\getScript
getScript(ResourceLoaderContext $context)
Definition: ResourceLoaderSyntaxHighlightVisualEditorModule.php:27
ResourceLoaderSyntaxHighlightVisualEditorModule\getPygmentsLanguages
getPygmentsLanguages()
Get a full list of available languages.
Definition: ResourceLoaderSyntaxHighlightVisualEditorModule.php:52
ResourceLoaderSyntaxHighlightVisualEditorModule\enableModuleContentVersion
enableModuleContentVersion()
Definition: ResourceLoaderSyntaxHighlightVisualEditorModule.php:59
ResourceLoaderFileModule
Module based on local JavaScript/CSS files.
Definition: ResourceLoaderFileModule.php:35
Xml\encodeJsCall
static encodeJsCall( $name, $args, $pretty=false)
Create a call to a JavaScript function.
Definition: Xml.php:677
SyntaxHighlightGeSHiCompat\getGeSHiToPygmentsMap
static getGeSHiToPygmentsMap()
Definition: SyntaxHighlightGeSHiCompat.php:110
SyntaxHighlightAce\getPygmentsToAceMap
static getPygmentsToAceMap()
Definition: SyntaxHighlightAce.php:160
ResourceLoaderSyntaxHighlightVisualEditorModule\$targets
$targets
Definition: ResourceLoaderSyntaxHighlightVisualEditorModule.php:21
$context
$context
Definition: load.php:45
ResourceLoaderFileModule\$scripts
array $scripts
List of paths to JavaScript files to always include.
Definition: ResourceLoaderFileModule.php:53
ResourceLoaderSyntaxHighlightVisualEditorModule\supportsURLLoading
supportsURLLoading()
Definition: ResourceLoaderSyntaxHighlightVisualEditorModule.php:66