2014-10-15 23:56:44 +00:00
|
|
|
/*!
|
2015-07-18 21:42:09 +00:00
|
|
|
* VisualEditor UserInterface MWTargetWidget class.
|
2014-10-15 23:56:44 +00:00
|
|
|
*
|
2017-01-03 16:58:33 +00:00
|
|
|
* @copyright 2011-2017 VisualEditor Team and others; see AUTHORS.txt
|
2014-10-15 23:56:44 +00:00
|
|
|
* @license The MIT License (MIT); see LICENSE.txt
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
2015-07-18 21:42:09 +00:00
|
|
|
* Creates an ve.ui.MWTargetWidget object.
|
2014-10-15 23:56:44 +00:00
|
|
|
*
|
|
|
|
* @class
|
|
|
|
* @abstract
|
2015-07-18 21:42:09 +00:00
|
|
|
* @extends ve.ui.TargetWidget
|
2014-10-15 23:56:44 +00:00
|
|
|
*
|
|
|
|
* @constructor
|
|
|
|
* @param {Object} [config] Configuration options
|
|
|
|
*/
|
2016-11-20 22:53:34 +00:00
|
|
|
ve.ui.MWTargetWidget = function VeUiMWTargetWidget() {
|
2014-10-15 23:56:44 +00:00
|
|
|
// Parent constructor
|
2016-11-20 22:53:34 +00:00
|
|
|
ve.ui.MWTargetWidget.super.apply( this, arguments );
|
2014-10-15 23:56:44 +00:00
|
|
|
|
|
|
|
// Initialization
|
2015-07-18 21:42:09 +00:00
|
|
|
this.$element.addClass( 've-ui-mwTargetWidget' );
|
2014-10-15 23:56:44 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/* Inheritance */
|
|
|
|
|
2015-07-18 21:42:09 +00:00
|
|
|
OO.inheritClass( ve.ui.MWTargetWidget, ve.ui.TargetWidget );
|
2016-11-20 22:53:34 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @inheritdoc
|
|
|
|
*/
|
|
|
|
ve.ui.MWTargetWidget.prototype.setDocument = function () {
|
|
|
|
// Parent method
|
|
|
|
ve.ui.MWTargetWidget.super.prototype.setDocument.apply( this, arguments );
|
|
|
|
|
|
|
|
// Add MW specific classes to the surface
|
|
|
|
this.surface.getView().$element.addClass( 'mw-body-content' );
|
|
|
|
this.surface.$placeholder.addClass( 'mw-body-content' );
|
|
|
|
};
|