mediawiki-extensions-CodeMi.../resources/modules/ve-cm/ve.ui.CodeMirror.init.js
Ed Sanders f5210867ba Respect beta feature in new wikitext editor
Bug: T173480
Change-Id: I2ca5a33f09aefe0c3d31082270869a13cee14fc4
2017-08-30 22:53:55 +01:00

15 lines
474 B
JavaScript

( function ( ve, mw ) {
if ( mw.config.get( 'wgCodeMirrorEnabled' ) ) {
mw.libs.ve.targetLoader.addPlugin( function () {
var i, target, index;
for ( i in ve.init.mw ) {
target = ve.init.mw[ i ];
if ( target === ve.init.mw.DesktopArticleTarget ) {
index = target.static.actionGroups[ 1 ].include.indexOf( 'changeDirectionality' );
target.static.actionGroups[ 1 ].include.splice( index, 0, 'codeMirror' );
}
}
} );
}
}( ve, mediaWiki ) );