diff --git a/CodeMirror.php b/CodeMirror.php index 4477e17d..9df05718 100644 --- a/CodeMirror.php +++ b/CodeMirror.php @@ -15,7 +15,7 @@ if ( !defined( 'MEDIAWIKI' ) ) { die( 'This file is an extension to MediaWiki and thus not a valid entry point.' ); } -const EXT_CODEMIRROR_VERSION = '3.1.1'; +const EXT_CODEMIRROR_VERSION = '3.1.2'; // Register this extension on Special:Version $wgExtensionCredits['parserhook'][] = array( diff --git a/resources/ext.CodeMirror.js b/resources/ext.CodeMirror.js index 69160e70..96fb1d04 100644 --- a/resources/ext.CodeMirror.js +++ b/resources/ext.CodeMirror.js @@ -7,8 +7,8 @@ api = new mw.Api(), // function for a textselection function for CodeMirror cmTextSelection = function ( command, options ) { - if ( !codeMirror ) { - return origTextSelection( command, options ); + if ( !codeMirror || codeMirror.getTextArea() !== this[0] ) { + return origTextSelection.call( this, command, options ); } var fn, retval; @@ -295,6 +295,7 @@ mwextModes: mw.config.get( 'extCodeMirrorExtModes' ), styleActiveLine: true, lineWrapping: true, + readOnly: textbox1[0].readOnly, // select mediawiki as text input mode mode: 'text/mediawiki' } );