mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-30 09:04:21 +00:00
c485bd4fce
Change-Id: I3ccea9a72f812e73bdc4d8d34635671dfd493be4
42 lines
1,016 B
JavaScript
42 lines
1,016 B
JavaScript
/*!
|
|
* VisualEditor UserInterface MWPreviewElement class.
|
|
*
|
|
* @copyright 2011-2017 VisualEditor Team and others; see AUTHORS.txt
|
|
* @license The MIT License (MIT); see LICENSE.txt
|
|
*/
|
|
|
|
/**
|
|
* Creates an ve.ui.MWPreviewElement object.
|
|
*
|
|
* @class
|
|
* @extends ve.ui.PreviewElement
|
|
*
|
|
* @constructor
|
|
* @param {ve.dm.Node} [model]
|
|
* @param {Object} [config]
|
|
*/
|
|
ve.ui.MWPreviewElement = function VeUiMwPreviewElement() {
|
|
// Parent constructor
|
|
ve.ui.MWPreviewElement.super.apply( this, arguments );
|
|
|
|
// Initialize
|
|
this.$element.addClass( 've-ui-mwPreviewElement mw-body-content' );
|
|
};
|
|
|
|
/* Inheritance */
|
|
|
|
OO.inheritClass( ve.ui.MWPreviewElement, ve.ui.PreviewElement );
|
|
|
|
/* Method */
|
|
|
|
/**
|
|
* @inheritdoc
|
|
*/
|
|
ve.ui.MWPreviewElement.prototype.replaceWithModelDom = function () {
|
|
// Parent method
|
|
ve.ui.MWPreviewElement.super.prototype.replaceWithModelDom.apply( this, arguments );
|
|
|
|
// TODO: Remove when fixed upstream in Parsoid (T58756)
|
|
this.$element.find( 'a[rel="mw:ExtLink"]' ).addClass( 'external' );
|
|
};
|