mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/CodeMirror
synced 2024-12-03 18:26:07 +00:00
47e42bc61b
The actionToolbar is deprecated and will be going away soon. Change-Id: I475e987959a037eaa536986cba063ab3ccc0083e
17 lines
529 B
JavaScript
17 lines
529 B
JavaScript
mw.loader.using( 'ext.visualEditor.targetLoader' ).then( function () {
|
|
mw.libs.ve.targetLoader.addPlugin( function () {
|
|
var target = ve.init.mw.DesktopArticleTarget;
|
|
if ( target ) {
|
|
var groups = target.static.toolbarGroups.concat( target.static.actionGroups );
|
|
groups.some( function ( group ) {
|
|
if ( group.name === 'pageMenu' ) {
|
|
var index = group.include.indexOf( 'changeDirectionality' );
|
|
group.include.splice( index, 0, 'codeMirror' );
|
|
return true;
|
|
}
|
|
return false;
|
|
} );
|
|
}
|
|
} );
|
|
} );
|