mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/CodeMirror
synced 2024-11-23 13:56:44 +00:00
Remove $wgCodeMirrorRTL as redundant config setting
This was introduced in Iac30ffe274 to control the rollout of CM6 to RTL wikis separately from LTR wikis because of various bugs. While RTL still isn't perfect, it is stable enough now (hewiki has not complained) and the 2017 editor is also fully supported. Thus, we no longer need this feature flag. Bug: T170001 Change-Id: Ia439527aaab07644b358cedf9603cd9d148b6608
This commit is contained in:
parent
2abaedf4c3
commit
b27c9843b5
|
@ -37,10 +37,6 @@
|
|||
"value": null,
|
||||
"description": "List of namespace IDs where line numbering should be enabled, or `null` to enable for all namespaces. Set to [] to disable everywhere.",
|
||||
"public": true
|
||||
},
|
||||
"CodeMirrorRTL": {
|
||||
"value": true,
|
||||
"description": "Temporary feature flag to control rollout of CodeMirror on RTL wikis."
|
||||
}
|
||||
},
|
||||
"MessagesDirs": {
|
||||
|
|
|
@ -61,7 +61,6 @@ class DataScript {
|
|||
'useV6' => $mwConfig->get( 'CodeMirrorV6' ),
|
||||
'lineNumberingNamespaces' => $mwConfig->get( 'CodeMirrorLineNumberingNamespaces' ),
|
||||
'templateFoldingNamespaces' => $mwConfig->get( 'CodeMirrorTemplateFoldingNamespaces' ),
|
||||
'isSupportedRtlWiki' => $mwConfig->get( 'CodeMirrorRTL' ),
|
||||
'pluginModules' => $registry->getAttribute( 'CodeMirrorPluginModules' ),
|
||||
'tagModes' => $tagModes,
|
||||
'tags' => array_fill_keys( $tagNames, true ),
|
||||
|
|
|
@ -28,7 +28,6 @@ class Hooks implements
|
|||
private UserOptionsLookup $userOptionsLookup;
|
||||
private array $conflictingGadgets;
|
||||
private bool $useV6;
|
||||
private bool $isSupportedRtlWiki;
|
||||
private ?GadgetRepo $gadgetRepo;
|
||||
|
||||
/**
|
||||
|
@ -44,7 +43,6 @@ class Hooks implements
|
|||
$this->userOptionsLookup = $userOptionsLookup;
|
||||
$this->useV6 = $config->get( 'CodeMirrorV6' );
|
||||
$this->conflictingGadgets = $config->get( 'CodeMirrorConflictingGadgets' );
|
||||
$this->isSupportedRtlWiki = $config->get( 'CodeMirrorRTL' );
|
||||
$this->gadgetRepo = $gadgetRepo;
|
||||
}
|
||||
|
||||
|
@ -80,7 +78,7 @@ class Hooks implements
|
|||
// Disable CodeMirror if we're on an edit page with a conflicting gadget. See T178348.
|
||||
return !$this->conflictingGadgetsEnabled( $extensionRegistry, $out->getUser() ) &&
|
||||
// CodeMirror 5 on textarea wikitext editors doesn't support RTL (T170001)
|
||||
( !$isRTL || ( $this->shouldUseV6( $out ) && $this->isSupportedRtlWiki ) ) &&
|
||||
( !$isRTL || $this->shouldUseV6( $out ) ) &&
|
||||
// Limit to supported content models that use wikitext.
|
||||
// See https://www.mediawiki.org/wiki/Content_handlers#Extension_content_handlers
|
||||
in_array( $out->getTitle()->getContentModel(), $contentModels );
|
||||
|
|
|
@ -249,8 +249,4 @@ ve.ui.CodeMirrorAction.prototype.onDocumentPrecommit = function ( tx ) {
|
|||
|
||||
/* Registration */
|
||||
|
||||
// eslint-disable-next-line no-jquery/no-global-selector
|
||||
const isRTL = $( '.mw-body-content .mw-parser-output' ).attr( 'dir' ) === 'rtl';
|
||||
if ( !isRTL || ( isRTL && mw.config.get( 'extCodeMirrorConfig' ).isSupportedRtlWiki ) ) {
|
||||
ve.ui.actionFactory.register( ve.ui.CodeMirrorAction );
|
||||
}
|
||||
ve.ui.actionFactory.register( ve.ui.CodeMirrorAction );
|
||||
|
|
|
@ -17,7 +17,6 @@ class DataScriptTest extends \MediaWikiIntegrationTestCase {
|
|||
$this->assertStringContainsString( '"extCodeMirrorConfig":', $script );
|
||||
$this->assertStringContainsString( '"lineNumberingNamespaces":', $script );
|
||||
$this->assertStringContainsString( '"templateFoldingNamespaces":', $script );
|
||||
$this->assertStringContainsString( '"isSupportedRtlWiki":', $script );
|
||||
$this->assertStringContainsString( '"pluginModules":', $script );
|
||||
$this->assertStringContainsString( '"tagModes":', $script );
|
||||
$this->assertStringContainsString( '"tags":', $script );
|
||||
|
|
Loading…
Reference in a new issue