mediawiki-extensions-Visual.../modules/ve-mw/ui/widgets/ve.ui.MWTargetWidget.js
Ed Sanders d42a0772bb Move verbose copyright message to AUTHORS.txt
Avoids having to update the date in every file every year,
which we stopped doing.

Change-Id: I7bf7aa0937eef911e00772470091753a7b06fd3d
2023-12-01 16:07:39 +00:00

45 lines
992 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
* @cfg {string[]} [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
} );
};