mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-12-18 17:21:25 +00:00
9ffbfc77cd
Bug: T250843 Change-Id: I53ef4fa4a65b017eec90cc1f2cbb7e7f0681e317
45 lines
1,001 B
JavaScript
45 lines
1,001 B
JavaScript
/*!
|
|
* VisualEditor UserInterface MWTargetWidget class.
|
|
*
|
|
* @copyright See AUTHORS.txt
|
|
* @license The MIT License (MIT); see LICENSE.txt
|
|
*/
|
|
|
|
/**
|
|
* Creates an ve.ui.MWTargetWidget object.
|
|
*
|
|
* @class
|
|
* @abstract
|
|
* @extends ve.ui.TargetWidget
|
|
*
|
|
* @constructor
|
|
* @param {Object} config
|
|
* @param {string[]} [config.surfaceClasses] Surface classes to apply
|
|
*/
|
|
ve.ui.MWTargetWidget = function VeUiMWTargetWidget( config ) {
|
|
this.surfaceClasses = ve.copy( config.surfaceClasses ) || [];
|
|
|
|
// Parent constructor
|
|
ve.ui.MWTargetWidget.super.apply( this, arguments );
|
|
|
|
// Initialization
|
|
this.$element.addClass( 've-ui-mwTargetWidget' );
|
|
};
|
|
|
|
/* Inheritance */
|
|
|
|
OO.inheritClass( ve.ui.MWTargetWidget, ve.ui.TargetWidget );
|
|
|
|
/**
|
|
* @inheritdoc
|
|
*/
|
|
ve.ui.MWTargetWidget.prototype.createTarget = function () {
|
|
return new ve.init.mw.Target( {
|
|
register: false,
|
|
toolbarGroups: this.toolbarGroups,
|
|
modes: this.modes,
|
|
defaultMode: this.defaultMode,
|
|
surfaceClasses: this.surfaceClasses
|
|
} );
|
|
};
|