mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/CodeMirror
synced 2024-12-18 00:30:30 +00:00
CodeMirror: load colorblind theme when preference is set
This is only done for wikitext, as the stylesheet only references .cm-mw-* classes. Change-Id: I15a82c7680a12fb10baff4a2e78626677536c291
This commit is contained in:
parent
75f5c9b2be
commit
5fe4ab8d58
2
resources/dist/main.js
vendored
2
resources/dist/main.js
vendored
File diff suppressed because one or more lines are too long
2
resources/dist/main.js.map.json
vendored
2
resources/dist/main.js.map.json
vendored
File diff suppressed because one or more lines are too long
|
@ -162,6 +162,15 @@ export default class CodeMirror {
|
||||||
parent: this.$textarea.parent()[ 0 ]
|
parent: this.$textarea.parent()[ 0 ]
|
||||||
} );
|
} );
|
||||||
|
|
||||||
|
// Add colorblind mode if preference is set.
|
||||||
|
// This currently is only to be used for the MediaWiki markup language.
|
||||||
|
if (
|
||||||
|
mw.user.options.get( 'usecodemirror-colorblind' ) &&
|
||||||
|
mw.config.get( 'wgPageContentModel' ) === 'wikitext'
|
||||||
|
) {
|
||||||
|
this.view.dom.classList.add( 'cm-mw-colorblind-colors' );
|
||||||
|
}
|
||||||
|
|
||||||
// Hide native textarea and sync CodeMirror contents upon submission.
|
// Hide native textarea and sync CodeMirror contents upon submission.
|
||||||
this.$textarea.hide();
|
this.$textarea.hide();
|
||||||
if ( this.$textarea[ 0 ].form ) {
|
if ( this.$textarea[ 0 ].form ) {
|
||||||
|
|
Loading…
Reference in a new issue