2016-05-26 12:08:26 +00:00
|
|
|
/*!
|
2017-01-17 22:00:30 +00:00
|
|
|
* VisualEditor UserInterface MWWikitextSurface class.
|
2016-05-26 12:08:26 +00:00
|
|
|
*
|
2018-01-03 00:54:47 +00:00
|
|
|
* @copyright 2011-2018 VisualEditor Team and others; see http://ve.mit-license.org
|
2016-05-26 12:08:26 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* A surface is a top-level object which contains both a surface model and a surface view.
|
|
|
|
* This is the mobile version of the surface.
|
|
|
|
*
|
|
|
|
* @class
|
2017-01-17 22:00:30 +00:00
|
|
|
* @extends ve.ui.Surface
|
2016-05-26 12:08:26 +00:00
|
|
|
*
|
|
|
|
* @constructor
|
|
|
|
* @param {HTMLDocument|Array|ve.dm.LinearData|ve.dm.Document} dataOrDoc Document data to edit
|
|
|
|
* @param {Object} [config] Configuration options
|
|
|
|
*/
|
2017-01-17 22:00:30 +00:00
|
|
|
ve.ui.MWWikitextSurface = function VeUiMWWikitextSurface() {
|
2016-05-26 12:08:26 +00:00
|
|
|
// Parent constructor
|
2017-01-17 22:00:30 +00:00
|
|
|
ve.ui.MWWikitextSurface.super.apply( this, arguments );
|
2016-05-26 12:08:26 +00:00
|
|
|
|
|
|
|
// Initialization
|
2016-09-07 21:45:59 +00:00
|
|
|
// The following classes can be used here:
|
|
|
|
// * mw-editfont-monospace
|
|
|
|
// * mw-editfont-sans-serif
|
|
|
|
// * mw-editfont-serif
|
2017-03-03 11:59:06 +00:00
|
|
|
this.$element.addClass( 've-ui-mwWikitextSurface' );
|
|
|
|
this.getView().$element.addClass( 'mw-editfont-' + mw.user.options.get( 'editfont' ) );
|
|
|
|
this.$placeholder.addClass( 'mw-editfont-' + mw.user.options.get( 'editfont' ) );
|
2016-05-26 12:08:26 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/* Inheritance */
|
|
|
|
|
2017-01-17 22:00:30 +00:00
|
|
|
OO.inheritClass( ve.ui.MWWikitextSurface, ve.ui.Surface );
|
2016-05-26 12:08:26 +00:00
|
|
|
|
|
|
|
/* Methods */
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @inheritdoc
|
|
|
|
*/
|
2017-01-17 22:00:30 +00:00
|
|
|
ve.ui.MWWikitextSurface.prototype.createModel = function ( doc ) {
|
2016-05-26 12:08:26 +00:00
|
|
|
return new ve.dm.MWWikitextSurface( doc );
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @inheritdoc
|
|
|
|
*/
|
2017-01-17 22:00:30 +00:00
|
|
|
ve.ui.MWWikitextSurface.prototype.createView = function ( model ) {
|
2016-05-26 12:08:26 +00:00
|
|
|
return new ve.ce.MWWikitextSurface( model, this );
|
|
|
|
};
|