mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/CodeMirror
synced 2024-11-12 00:38:51 +00:00
Remove $wgCodeMirrorEnableBracketMatching feature flag
Bug: T307188 Change-Id: Ibb21dea29c87d8fac898506c19f329273348c190
This commit is contained in:
parent
8eb2f13889
commit
9f34c4d220
|
@ -15,11 +15,6 @@
|
|||
"MediaWiki": ">= 1.38.0"
|
||||
},
|
||||
"config": {
|
||||
"CodeMirrorEnableBracketMatching": {
|
||||
"value": false,
|
||||
"description": "Temporary feature flag for the matchbrackets addon.",
|
||||
"public": true
|
||||
},
|
||||
"CodeMirrorColorblindColors": {
|
||||
"value": false,
|
||||
"description": "Temporary feature flag for colorblind-friendly colors.",
|
||||
|
|
|
@ -5,7 +5,6 @@ namespace MediaWiki\Extension\CodeMirror;
|
|||
use Config;
|
||||
use MediaWiki\MediaWikiServices;
|
||||
use OutputPage;
|
||||
use RequestContext;
|
||||
use Skin;
|
||||
use User;
|
||||
|
||||
|
@ -65,11 +64,6 @@ class Hooks {
|
|||
/** @var Config $config */
|
||||
$config = MediaWikiServices::getInstance()->getMainConfig();
|
||||
|
||||
$vars['wgCodeMirrorEnableBracketMatching'] = $config->get( 'CodeMirrorEnableBracketMatching' )
|
||||
// Allows tests to override the configuration.
|
||||
|| RequestContext::getMain()->getRequest()
|
||||
->getCookie( '-codemirror-bracket-matching-test', 'mw' );
|
||||
|
||||
$vars['wgCodeMirrorColorblindColors'] = $config->get( 'CodeMirrorColorblindColors' );
|
||||
|
||||
$vars['wgCodeMirrorLineNumberingNamespaces'] = $config->get( 'CodeMirrorLineNumberingNamespaces' );
|
||||
|
|
|
@ -201,12 +201,10 @@
|
|||
viewportMargin: Infinity
|
||||
};
|
||||
|
||||
if ( mw.config.get( 'wgCodeMirrorEnableBracketMatching' ) ) {
|
||||
cmOptions.matchBrackets = {
|
||||
highlightNonMatching: false,
|
||||
maxHighlightLineLength: 10000
|
||||
};
|
||||
}
|
||||
cmOptions.matchBrackets = {
|
||||
highlightNonMatching: false,
|
||||
maxHighlightLineLength: 10000
|
||||
};
|
||||
|
||||
codeMirror = CodeMirror.fromTextArea( $textbox1[ 0 ], cmOptions );
|
||||
$codeMirror = $( codeMirror.getWrapperElement() );
|
||||
|
|
|
@ -95,12 +95,10 @@ ve.ui.CodeMirrorAction.prototype.toggle = function ( enable ) {
|
|||
}
|
||||
};
|
||||
|
||||
if ( mw.config.get( 'wgCodeMirrorEnableBracketMatching' ) ) {
|
||||
cmOptions.matchBrackets = {
|
||||
highlightNonMatching: false,
|
||||
maxHighlightLineLength: 10000
|
||||
};
|
||||
}
|
||||
cmOptions.matchBrackets = {
|
||||
highlightNonMatching: false,
|
||||
maxHighlightLineLength: 10000
|
||||
};
|
||||
|
||||
if ( ve.ui.CodeMirrorAction.static.isLineNumbering() ) {
|
||||
$.extend( cmOptions, {
|
||||
|
|
|
@ -1,14 +0,0 @@
|
|||
'use strict';
|
||||
|
||||
// Temporary, can be removed along with the feature flag.
|
||||
|
||||
class HighlightingFeatureFlag {
|
||||
enable() {
|
||||
browser.setCookies( {
|
||||
name: 'mw-codemirror-bracket-matching-test',
|
||||
value: '1'
|
||||
} );
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = new HighlightingFeatureFlag();
|
|
@ -1,24 +0,0 @@
|
|||
'use strict';
|
||||
|
||||
const assert = require( 'assert' ),
|
||||
EditPage = require( '../pageobjects/edit.page' ),
|
||||
FixtureContent = require( '../fixturecontent' ),
|
||||
LoginPage = require( 'wdio-mediawiki/LoginPage' ),
|
||||
UserPreferences = require( '../userpreferences' );
|
||||
|
||||
describe( 'CodeMirror bracket match default', function () {
|
||||
before( function () {
|
||||
LoginPage.loginAdmin();
|
||||
UserPreferences.enableWikitext2010EditorWithCodeMirror();
|
||||
this.title = FixtureContent.createFixturePage();
|
||||
} );
|
||||
|
||||
it( 'disables highlighting', function () {
|
||||
EditPage.openForEditing( this.title );
|
||||
EditPage.wikiEditorToolbar.waitForDisplayed();
|
||||
EditPage.clickText();
|
||||
|
||||
EditPage.cursorToPosition( 0 );
|
||||
assert.strictEqual( EditPage.getHighlightedMatchingBrackets(), '' );
|
||||
} );
|
||||
} );
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
const assert = require( 'assert' ),
|
||||
EditPage = require( '../pageobjects/edit.page' ),
|
||||
FeatureFlag = require( '../highlightingfeatureflag' ),
|
||||
FixtureContent = require( '../fixturecontent' ),
|
||||
LoginPage = require( 'wdio-mediawiki/LoginPage' ),
|
||||
UserPreferences = require( '../userpreferences' );
|
||||
|
@ -12,7 +11,6 @@ describe( 'CodeMirror bracket match highlighting for the wikitext 2010 editor',
|
|||
LoginPage.loginAdmin();
|
||||
this.title = FixtureContent.createFixturePage();
|
||||
UserPreferences.enableWikitext2010EditorWithCodeMirror();
|
||||
FeatureFlag.enable();
|
||||
} );
|
||||
|
||||
beforeEach( function () {
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
const assert = require( 'assert' ),
|
||||
EditPage = require( '../pageobjects/edit.page' ),
|
||||
FeatureFlag = require( '../highlightingfeatureflag' ),
|
||||
FixtureContent = require( '../fixturecontent' ),
|
||||
LoginPage = require( 'wdio-mediawiki/LoginPage' ),
|
||||
UserPreferences = require( '../userpreferences' );
|
||||
|
@ -12,7 +11,6 @@ describe( 'CodeMirror bracket match highlighting for the wikitext 2017 editor',
|
|||
LoginPage.loginAdmin();
|
||||
this.title = FixtureContent.createFixturePage();
|
||||
UserPreferences.enableWikitext2017EditorWithCodeMirror();
|
||||
FeatureFlag.enable();
|
||||
} );
|
||||
|
||||
beforeEach( function () {
|
||||
|
|
Loading…
Reference in a new issue