mediawiki-extensions-CodeMi.../resources/modules/ve-cm/ve.ui.CodeMirror.init.js
Ed Sanders 7b01a98ad0 VisualEditor source mode support
Long-term todo:
* Performance will be poor on large pages due
  to using a auto-height textarea which CodeMirror
  doesn't optimise.

Change-Id: I16598fcdbeee51e6fae88376ec81f1c8552b383d
2017-05-08 16:54:10 +01:00

13 lines
412 B
JavaScript

( function ( ve, mw ) {
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 ) );