Remove $wgCodeMirrorAccessibilityColors feature flag

Get rid of the flag, without making any substantial changes to the
code.  A follow-up commit will merge the CSS into base rules.

Bug: T307188
Change-Id: I601df5047d0db3cfb9559538487d3d39bb6c7cf4
This commit is contained in:
Adam Wight 2022-06-10 15:49:48 +02:00
parent cca42569b5
commit 396d50cd5d
4 changed files with 8 additions and 19 deletions

View file

@ -20,14 +20,9 @@
"description": "Temporary feature flag for the matchbrackets addon.",
"public": true
},
"CodeMirrorAccessibilityColors": {
"value": false,
"description": "Temporary feature flag for accessibility colors.",
"public": true
},
"CodeMirrorColorblindColors": {
"value": false,
"description": "Temporary feature flag for colorblind-friendly colors. Depends on the CodeMirrorAccessibilityColors setting being enabled as well.",
"description": "Temporary feature flag for colorblind-friendly colors.",
"public": true
},
"CodeMirrorLineNumberingNamespaces": {

View file

@ -70,8 +70,6 @@ class Hooks {
|| RequestContext::getMain()->getRequest()
->getCookie( '-codemirror-bracket-matching-test', 'mw' );
$vars['wgCodeMirrorAccessibilityColors'] = $config->get( 'CodeMirrorAccessibilityColors' );
$vars['wgCodeMirrorColorblindColors'] = $config->get( 'CodeMirrorColorblindColors' );
$vars['wgCodeMirrorLineNumberingNamespaces'] = $config->get( 'CodeMirrorLineNumberingNamespaces' );
@ -93,7 +91,7 @@ class Hooks {
];
$config = MediaWikiServices::getInstance()->getMainConfig();
if ( $config->get( 'CodeMirrorAccessibilityColors' ) && $config->get( 'CodeMirrorColorblindColors' ) ) {
if ( $config->get( 'CodeMirrorColorblindColors' ) ) {
$defaultPreferences['usecodemirror-colorblind'] = [
'type' => 'toggle',
'label-message' => 'codemirror-prefs-colorblind',

View file

@ -250,11 +250,9 @@
// T194102: UniversalLanguageSelector integration is buggy, disabling it completely
.addClass( 'noime' );
if ( mw.config.get( 'wgCodeMirrorAccessibilityColors' ) ) {
$codeMirror.addClass( 'cm-mw-accessible-colors' );
if ( mw.config.get( 'wgCodeMirrorColorblindColors' ) && mw.user.options.get( 'usecodemirror-colorblind' ) ) {
$codeMirror.addClass( 'cm-mw-colorblind-colors' );
}
$codeMirror.addClass( 'cm-mw-accessible-colors' );
if ( mw.config.get( 'wgCodeMirrorColorblindColors' ) && mw.user.options.get( 'usecodemirror-colorblind' ) ) {
$codeMirror.addClass( 'cm-mw-colorblind-colors' );
}
// T305333: Reload CodeMirror to fix a cursor caret issue.

View file

@ -121,11 +121,9 @@ ve.ui.CodeMirrorAction.prototype.toggle = function ( enable ) {
// so revert any editfont user preference
surfaceView.$element.removeClass( 'mw-editfont-sans-serif mw-editfont-serif' ).addClass( 'mw-editfont-monospace' );
if ( mw.config.get( 'wgCodeMirrorAccessibilityColors' ) ) {
surfaceView.$element.addClass( 'cm-mw-accessible-colors' );
if ( mw.config.get( 'wgCodeMirrorColorblindColors' ) && mw.user.options.get( 'usecodemirror-colorblind' ) ) {
surfaceView.$element.addClass( 'cm-mw-colorblind-colors' );
}
surfaceView.$element.addClass( 'cm-mw-accessible-colors' );
if ( mw.config.get( 'wgCodeMirrorColorblindColors' ) && mw.user.options.get( 'usecodemirror-colorblind' ) ) {
surfaceView.$element.addClass( 'cm-mw-colorblind-colors' );
}
var profile = $.client.profile();