Merge "Remove $wgCodeMirrorRTL as redundant config setting"

This commit is contained in:
jenkins-bot 2024-09-19 17:09:17 +00:00 committed by Gerrit Code Review
commit a32d8005ea
5 changed files with 2 additions and 14 deletions

View file

@ -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": {

View file

@ -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 ),

View file

@ -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 );

View file

@ -245,8 +245,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 );
}

View file

@ -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 );