/*! * VisualEditor MWInternalLinkContextItem class. * * @copyright 2011-2020 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 ]; /* Static methods */ /** * Generate the body of the link context item * * @param {ve.init.mw.LinkCache} linkCache The link cache to use * @param {ve.dm.MWInternalLinkAnnotation} model The annotation model * @param {HTMLDocument} htmlDoc The HTML document (for URL resolution) * @param {ve.ui.Context} context Context (for resizing) * @return {jQuery} The jQuery object of the link context item */ ve.ui.MWInternalLinkContextItem.static.generateBody = function ( linkCache, model, htmlDoc, context ) { var icon, $description, title = model.getAttribute( 'lookupTitle' ), normalizedTitle = model.getAttribute( 'normalizedTitle' ), href = model.getHref(), titleObj = mw.Title.newFromText( mw.libs.ve.normalizeParsoidResourceName( href ) ), fragment = model.getFragment(), usePageImages = mw.config.get( 'wgVisualEditorConfig' ).usePageImages, usePageDescriptions = mw.config.get( 'wgVisualEditorConfig' ).usePageDescriptions, $wrapper = $( '