mediawiki-extensions-Visual.../modules/ve-mw/ui/ve.ui.MWWikitextSurface.js
Ed Sanders 63607c4cff Remove reference to editfont-default
Bug: T170223
Depends-On: I1ace59c980740fc785ccbd500e19cc8b71d46a5b
Change-Id: I2ac04df04b6652b47490dff5202683c041178a2c
2017-08-25 18:44:53 +01:00

51 lines
1.4 KiB
JavaScript

/*!
* VisualEditor UserInterface MWWikitextSurface class.
*
* @copyright 2011-2017 VisualEditor Team and others; see http://ve.mit-license.org
*/
/**
* 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
* @extends ve.ui.Surface
*
* @constructor
* @param {HTMLDocument|Array|ve.dm.LinearData|ve.dm.Document} dataOrDoc Document data to edit
* @param {Object} [config] Configuration options
*/
ve.ui.MWWikitextSurface = function VeUiMWWikitextSurface() {
// Parent constructor
ve.ui.MWWikitextSurface.super.apply( this, arguments );
// Initialization
// The following classes can be used here:
// * mw-editfont-monospace
// * mw-editfont-sans-serif
// * mw-editfont-serif
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' ) );
};
/* Inheritance */
OO.inheritClass( ve.ui.MWWikitextSurface, ve.ui.Surface );
/* Methods */
/**
* @inheritdoc
*/
ve.ui.MWWikitextSurface.prototype.createModel = function ( doc ) {
return new ve.dm.MWWikitextSurface( doc );
};
/**
* @inheritdoc
*/
ve.ui.MWWikitextSurface.prototype.createView = function ( model ) {
return new ve.ce.MWWikitextSurface( model, this );
};