/*! * VisualEditor MWInternalLinkContextItem class. * * @copyright 2011-2016 VisualEditor Team and others; see http://ve.mit-license.org */ /** * Context item for a MWInternalLink. * * @class * @extends ve.ui.LinkContextItem * * @constructor * @param {ve.ui.Context} context Context item is in * @param {ve.dm.Model} model Model item is related to * @param {Object} config Configuration options */ ve.ui.MWInternalLinkContextItem = function VeUiMWInternalLinkContextItem() { // Parent constructor ve.ui.MWInternalLinkContextItem.super.apply( this, arguments ); // Initialization this.$element.addClass( 've-ui-mwInternalLinkContextItem' ); }; /* Inheritance */ OO.inheritClass( ve.ui.MWInternalLinkContextItem, ve.ui.LinkContextItem ); /* Static Properties */ ve.ui.MWInternalLinkContextItem.static.name = 'link/internal'; ve.ui.MWInternalLinkContextItem.static.modelClasses = [ ve.dm.MWInternalLinkAnnotation ]; /* Methods */ /** * @inheritdoc */ ve.ui.MWInternalLinkContextItem.prototype.getDescription = function () { return this.model.getAttribute( 'normalizedTitle' ); }; /** * @inheritdoc */ ve.ui.MWInternalLinkContextItem.prototype.renderBody = function () { var icon, $description, usePageImages = mw.config.get( 'wgVisualEditor' ).usePageImages, usePageDescriptions = mw.config.get( 'wgVisualEditor' ).usePageDescriptions, title = this.model.getAttribute( 'lookupTitle' ), htmlDoc = this.context.getSurface().getModel().getDocument().getHtmlDocument(), $wrapper = $( '